Exemplo n.º 1
0
 public Tile(Point location, TileResource res, TileTerrainBase tbase, TileTerrainFeature tfeature, TileImprovment impr)
 {
     Pillaged       = false;
     Location       = location;
     Resource       = res;
     TerrainBase    = tbase;
     TerrainFeature = tfeature;
     Improvement    = impr;
     CityID         = -1;
 }
Exemplo n.º 2
0
        /// <summary>
        /// Builds the given improvment on the given tile for the player with the given id
        /// </summary>
        /// <param name="tile"></param>
        /// <param name="playerID"></param>
        /// <param name="improvment"></param>
        /// <returns></returns>
        public bool BuildImprovment(Tile tile, int playerID, TileImprovment improvment)
        {
            // Check if the player owns the tile
            City city = Controllers.City.GetCity(tile.CityID);

            if (city == null || city.PlayerID != playerID)
            {
                return(false);
            }

            tile.ConstructionProgress = 0;
            tile.CurrentConstruction  = improvment;

            return(true);
        }