Original Post
In my current project I'm trying to create an text based rpg engine.
The main classes are: Engine.cs, World.cs, Entity.cs, Event.cs and Dialog.cs
The Engine contains Handlers for handling and processing Dialogs and Events that occures during the game as well as an World object that contains all game data as monsters, player status, rooms ect.
My problem is my Entity's aswell as the battle engine need to be able to push Events and Dialogs inside the queue so that they can be processed by the engine handlers.
So: Engine->World->Entitys->Events.
So I'v been thinking should i add an object refrence to EACH of the games entitys to the Engine object? So that they can access the methods to be able to push events and dialogs inside the queue? It seams quite inefficient :S
But i can't think of another way really...
The Handlers ( Input, Event, Dialog and well World object each gets a refrence to the owning Engine object. ) like InputHandler inputmanager = new InputHandler(this); inside the Engine objects constructor.
The world object also gets this refrence...
Any ideas or tips?
The main classes are: Engine.cs, World.cs, Entity.cs, Event.cs and Dialog.cs
The Engine contains Handlers for handling and processing Dialogs and Events that occures during the game as well as an World object that contains all game data as monsters, player status, rooms ect.
My problem is my Entity's aswell as the battle engine need to be able to push Events and Dialogs inside the queue so that they can be processed by the engine handlers.
So: Engine->World->Entitys->Events.
So I'v been thinking should i add an object refrence to EACH of the games entitys to the Engine object? So that they can access the methods to be able to push events and dialogs inside the queue? It seams quite inefficient :S
But i can't think of another way really...
The Handlers ( Input, Event, Dialog and well World object each gets a refrence to the owning Engine object. ) like InputHandler inputmanager = new InputHandler(this); inside the Engine objects constructor.
The world object also gets this refrence...
Any ideas or tips?