Guest User

Untitled

a guest
Nov 18th, 2018
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. {Initializing}
  2.  
  3. //in order
  4. [Game]--set event list--[EventManager]--requests list of EventEntity--[Game]--sends list of EventEntity--[EventManager]
  5.  
  6. {EventManager loop}
  7.  
  8. [EventManager]--checks if any of the events meet in an EventEntity
  9. [EventManager]--if any meets--[EventManager]--checks if all of the conditions are meeting in the EventEntity
  10. [EventManager]--if all meets--[EventManager]--fires actions of the EventEntity
  11.  
  12. {Architecture of the Models}
  13.  
  14. [EventEntity] contains
  15. - [List of Event Models]
  16. - [List of Condition Models]
  17. - [List of Action Models]
  18.  
  19. [EventModel] contains
  20. //quite similar to the ConditionModel, an event only should fire, aka check the conditions and
  21. //fire the actions, if these special conditions, happenings, events are fired
  22. //like a unit dies, player reaches a specific position, etc.
  23.  
  24. [ConditionModel] contains
  25. //model must simulate AND, OR logic statements
  26. //model must simulate IF statements
  27.  
  28. [ActionModel] contains
  29. - [List of Targets]
  30. - [List of Action IDs] //One action per Target, a specific Target can be listed more than once in the [List of Targets]
  31. //something is missing
  32.  
  33. Event {
  34. List ids;
  35. Action action;
  36. List args;
  37. }
  38.  
  39. EventManager {
  40. Queue events;
  41. Dictionary listeners;
  42.  
  43. addEvent(Event event);
  44. delegateEvents();
  45.  
  46. addListener(String id, Listener listener);
  47. }
  48.  
  49. Listener {
  50. Queue events;
  51. }
Add Comment
Please, Sign In to add comment