Esempio n. 1
0
 protected override void Initialize()
 {
     spriteBatch = new SpriteBatch(Game.GraphicsDevice);
       worldManager = WorldManager.GetInstance(Game);
 }
Esempio n. 2
0
        /// <summary>
        /// Returns the single WorldManager instance that exists.
        /// </summary>
        /// <param name="game">Necessary for instancing the singleton.</param>
        /// <returns>The singleton instance.</returns>
        public static WorldManager GetInstance(Game game)
        {
            if (singleton == null)
              {
            singleton = new WorldManager(game);
              }

              return singleton;
        }
Esempio n. 3
0
 /// <summary>
 /// Changes the entity's cluster, and moves its
 /// position relative to the new cluster
 /// </summary>
 /// <param name="newClusterPosition">
 /// The new position, relative to the new cluster
 /// </param>
 /// <param name="worldManager">
 /// Used to ensure that it is the world manager that calls the method
 /// </param>
 public void ChangeCluster(Vector2 newClusterPosition, WorldManager worldManager)
 {
     positionInCluster = newClusterPosition;
 }