using Godot; namespace Rokojori { public class SequenceActionFinishedEvent { public int id; public bool success; } [GlobalClass ] public partial class SequenceAction : Action { /* int dispatchStart(); void dispatchCancelled( int id ); void dispatchEnd( int id ); int getLastSequenceActionID(); GDVIRTUAL1( cancelAction, int ); /* signal onSequenceDone * / */ int _dispatchCounter = 0; public int GetLastSequenceActionID() { return _dispatchCounter; } public readonly EventSlot onSequenceDone = new EventSlot(); public int DispatchStart() { _dispatchCounter ++; return _dispatchCounter; } public void DispatchEnd( int id ) { onSequenceDone.DispatchEvent( new SequenceActionFinishedEvent{ id = id, success = true } ); } public void DispatchCancelled( int id ) { onSequenceDone.DispatchEvent( new SequenceActionFinishedEvent{ id = id, success = false } ); } public virtual void CancelAction( int id ) { } } }