mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-14 13:53:47 +00:00
Event System
This commit is contained in:
parent
797e24d766
commit
f379eac5c3
10 changed files with 336 additions and 10 deletions
|
|
@ -46,17 +46,36 @@ public partial class Door : Activable
|
|||
|
||||
public override void Activate(ActivationType activationType = ActivationType.Toggle)
|
||||
{
|
||||
switch (State)
|
||||
switch (activationType)
|
||||
{
|
||||
case DoorState.Closed:
|
||||
case ActivationType.Toggle:
|
||||
switch (State)
|
||||
{
|
||||
case DoorState.Closed:
|
||||
Open();
|
||||
break;
|
||||
case DoorState.Open:
|
||||
Close();
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException();
|
||||
}
|
||||
break;
|
||||
case ActivationType.Enable:
|
||||
Open();
|
||||
break;
|
||||
case DoorState.Open:
|
||||
case ActivationType.Disable:
|
||||
Close();
|
||||
break;
|
||||
case ActivationType.Use:
|
||||
break;
|
||||
case ActivationType.Destroy:
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException();
|
||||
throw new ArgumentOutOfRangeException(nameof(activationType), activationType, null);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void SetState(DoorState state)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue