Exemple #1
0
        /// <summary>
        /// Creates an new game instance.
        /// </summary>
        /// <param name="gameConfiguration"></param>
        public Game(Config gameConfiguration)
        {
            PathFinder.Initialize(this);
            CornerSmoother.Initialize(this, gameConfiguration.Seed);

            _configuration = gameConfiguration;
            _gameWorld     = new Map(gameConfiguration);
            _gameWorld.GenerateLands(gameConfiguration.Seed);
            _entities           = new List <Entity>();
            _view               = new View(_gameWorld);
            _selection          = new List <Entity>();
            _firstPersonSpawned = false;
            _entityFactory      = new EntityFactory();
            _entityFactory.AddObserver(this);
        }
Exemple #2
0
 public void AddFactoryObserver(IFactoryObserver observer)
 {
     _entityFactory.AddObserver(observer);
 }