cirnogodot/Scripts/Components/FSM/Elevator/Bottom.cs
2025-03-06 10:27:06 +01:00

47 lines
No EOL
1.1 KiB
C#

using System;
using Cirno.Scripts.Enums;
using Godot;
namespace Cirno.Scripts.Components.FSM.Elevator;
public partial class Bottom : BaseState<ElevatorState, ElevatorProxy>
{
public override ElevatorState StateId => ElevatorState.Bottom;
public override void EnterState()
{
MainObject.SetPosition(MainObject.Bottom);
MainObject.Activated += ElevatorActivated;
}
private void ElevatorActivated(ActivationType type)
{
switch (type)
{
case ActivationType.Use:
case ActivationType.Toggle:
MoveToTop();
break;
case ActivationType.Enable:
break;
case ActivationType.Disable:
break;
case ActivationType.Destroy:
break;
case ActivationType.Open:
break;
case ActivationType.Close:
break;
}
}
private void MoveToTop()
{
StateMachine.SetState(ElevatorState.Ascending);
}
public override void ExitState()
{
MainObject.Activated -= ElevatorActivated;
}
}