Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {Initializing}
- //in order
- [Game]--set event list--[EventManager]--requests list of EventEntity--[Game]--sends list of EventEntity--[EventManager]
- {EventManager loop}
- [EventManager]--checks if any of the events meet in an EventEntity
- [EventManager]--if any meets--[EventManager]--checks if all of the conditions are meeting in the EventEntity
- [EventManager]--if all meets--[EventManager]--fires actions of the EventEntity
- {Architecture of the Models}
- [EventEntity] contains
- - [List of Event Models]
- - [List of Condition Models]
- - [List of Action Models]
- [EventModel] contains
- //quite similar to the ConditionModel, an event only should fire, aka check the conditions and
- //fire the actions, if these special conditions, happenings, events are fired
- //like a unit dies, player reaches a specific position, etc.
- [ConditionModel] contains
- //model must simulate AND, OR logic statements
- //model must simulate IF statements
- [ActionModel] contains
- - [List of Targets]
- - [List of Action IDs] //One action per Target, a specific Target can be listed more than once in the [List of Targets]
- //something is missing
- Event {
- List ids;
- Action action;
- List args;
- }
- EventManager {
- Queue events;
- Dictionary listeners;
- addEvent(Event event);
- delegateEvents();
- addListener(String id, Listener listener);
- }
- Listener {
- Queue events;
- }
Add Comment
Please, Sign In to add comment