public Tile(TextureLibrary textureLibrary, Rectangle location) { _textureLibrary = textureLibrary; _location = location; // Largest possible square inside hexagon has dimensions 0.634 * a, where a is the hexagon height & width // Give any object to be placed on this tile these (max) dimensions int objectDimensions = (int)Math.Floor(_location.Width * 0.634); int fromEdgePixels = (_location.Width - objectDimensions) / 2; _objectLocation = new Rectangle( _location.X + fromEdgePixels, _location.Y + fromEdgePixels, objectDimensions, objectDimensions); }
/// <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(); }
public Tower(TextureLibrary textureLibrary, Player owner) : base(textureLibrary, owner) { }
public Britons(TextureLibrary textureLibrary) : base(textureLibrary) { }
public VillagerFactory(TextureLibrary textureLibrary) : base(textureLibrary) { Type = typeof(Villager); }
protected PlaceableObjectFactory(TextureLibrary textureLibrary) { TextureLibrary = textureLibrary; SetBaseStats(); }
public Blacksmith(TextureLibrary textureLibrary, Player owner) : base(textureLibrary, owner) { }
protected Civilization(TextureLibrary textureLibrary) { TextureLibrary = textureLibrary; }
public MapGenerator(TextureLibrary textureLibrary, int tileRelativeSize) { _textureLibrary = textureLibrary; _tileDimensions = tileRelativeSize * 4; }
public Villager(TextureLibrary textureLibrary, Player owner) : base(textureLibrary, owner) { }
public TownCenterFactory(TextureLibrary textureLibrary) : base(textureLibrary) { Type = typeof(TownCenter); }