Guest User

Untitled

a guest
Apr 21st, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. public class ArenaTimeout:IAction
  2. {
  3. public ArenaTimeout(UpdateList _owner, uint _timeout, bool _expires = true)
  4. {
  5. Owner = _owner;
  6. Expires = _expires;
  7. Timeout = _timeout;
  8. Trigger = Finished;
  9. //If it required input we would do something like...
  10. //Trigger = new Action(() => Finished(true));
  11. }
  12. UpdateList Owner;
  13. public bool Expires;
  14. public uint Timeout {get;set;}
  15. Action Trigger;
  16. //We've satisfied the IAction interface now anything else is just extra convenience
  17. public void Finished()
  18. {
  19. //Execute completion code
  20. if(Expires)
  21. Owner.Remove(this);
  22. }
  23. }
Add Comment
Please, Sign In to add comment