2023-05-23 00:23:53 -07:00
|
|
|
using Godot;
|
|
|
|
|
2023-05-26 17:42:50 -07:00
|
|
|
namespace SupaLidlGame.State.Weapon
|
2023-05-23 00:23:53 -07:00
|
|
|
{
|
2023-05-26 17:42:50 -07:00
|
|
|
public partial class WeaponStateMachine : StateMachine<WeaponState>
|
2023-05-23 00:23:53 -07:00
|
|
|
{
|
|
|
|
[Export]
|
2023-05-26 17:42:50 -07:00
|
|
|
public override WeaponState InitialState { get; set; }
|
2023-05-23 00:23:53 -07:00
|
|
|
|
|
|
|
public void Use()
|
|
|
|
{
|
|
|
|
var state = CurrentState.Use();
|
2023-05-26 22:28:08 -07:00
|
|
|
if (state is WeaponState)
|
|
|
|
{
|
|
|
|
ChangeState(state);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public void Deuse()
|
|
|
|
{
|
|
|
|
var state = CurrentState.Deuse();
|
|
|
|
if (state is WeaponState)
|
2023-05-23 00:23:53 -07:00
|
|
|
{
|
|
|
|
ChangeState(state);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public void Process(double delta)
|
|
|
|
{
|
|
|
|
var state = CurrentState.Process(delta);
|
2023-05-26 17:42:50 -07:00
|
|
|
if (state is WeaponState s)
|
2023-05-23 00:23:53 -07:00
|
|
|
{
|
|
|
|
ChangeState(s);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|