Пример #1
0
        public Player(Civilization civilization, TileColor color, ResearchLibrary researchLibrary)
        {
            Color            = color;
            Civilization     = civilization;
            _researchLibrary = researchLibrary;

            OwnedObjects = new List <PlayerObject>();

            ResourceCollection = new ResourceCollection();
            Factories          = Civilization.GetFactories();
        }
Пример #2
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            _spriteBatch = new SpriteBatch(GraphicsDevice);

            var textureLibrary  = new TextureLibrary(Content);
            var researchLibrary = new ResearchLibrary();

            var mapGenerator = new MapGenerator(textureLibrary, 14);
            Map gameMap      = mapGenerator.GenerateMap(25, 22);
            var players      = new List <Player>
            {
                new Player(new Britons(textureLibrary), TileColor.Blue, researchLibrary),
                new Player(new Britons(textureLibrary), TileColor.Red, researchLibrary)
            };

            _game = new Game(players, gameMap);
            _game.PlaceStartingTownCenters();
        }