using Godot; namespace SupaLidlGame.Characters.State { public partial class CharacterState : Node { public Character Character { get; set; } /// /// Called when the Character enters this CharacterState. /// /// /// This returns a CharacterState in case a state is being /// transitioned to but wants to transition to another state. For /// example, an attack state can return to an idle state, but that idle /// state can override it to the move state immediately when necessary. /// public virtual CharacterState Enter(CharacterState previousState) => null; /// /// Called when the Character exits this CharacterState. /// public virtual void Exit(CharacterState nextState) { } public virtual CharacterState Process(double delta) => null; public virtual CharacterState PhysicsProcess(double delta) { Character.Velocity = Character.Direction * Character.Speed; Character.ModifyVelocity(); Character.MoveAndSlide(); return null; } public virtual CharacterState Input(InputEvent @event) => null; } }