Ejemplo n.º 1
0
        private readonly ISceneStateManager sceneStateManager;                // Reference to a scene state manager.

        /// <summary>
        /// Constructor for the entity manager.
        /// </summary>
        /// <param name="loadSystem">The load system.</param>
        /// <param name="sceneManager">The reference to a scene manager.</param>
        /// <param name="sceneStateManager">The reference to a scene state manager.</param>
        public EntityManager(ISystem loadSystem, ISceneManager sceneManager, ISceneStateManager sceneStateManager)
        {
            // Initialise maps.
            activeEntities   = new Dictionary <int, AbstractEntity>();
            inactiveEntities = new Dictionary <Type, IList <AbstractEntity> >();

            // Store managers and systems.
            this.loadSystem        = loadSystem;
            this.sceneManager      = sceneManager;
            this.sceneStateManager = sceneStateManager;
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Initialises the entity to its initial state.
 /// </summary>
 /// <param name="position">The starting position of the entity.</param>
 /// <param name="entityTerminator">The entity terminator.</param>
 /// <param name="sceneStateManager">The scene state manager.</param>
 public virtual void Initialise(Vector3 position, IEntityTerminator entityTerminator, ISceneStateManager sceneStateManager)
 {
     Position = position;
     this.entityTerminator  = entityTerminator;
     this.sceneStateManager = sceneStateManager;
 }