public void AddFoodToTile(GameTile tile, decimal amountOfFood) { var randomNumber = Random.Next (2); if (randomNumber < amountOfFood) { tile.Inventory [ItemType.Food] += amountOfFood; } }
public GameEnvironment(EngineContext context) { Context = context; Populator = new GameEnvironmentPopulator (this); PersonCreator = new PersonCreator (context.Settings); PlantCreator = new PlantCreator (context.Settings); Tiles = new GameTile[]{}; People = new Person[] {}; Plants = new Plant[]{ }; Logic = new GameLogic (); Tiles = new GameTile[]{new GameTile(this)}; }
public GameTile CreateTile() { var tile = new GameTile(World); return(tile); }
public void AddPeopleToTile(GameTile tile, decimal numberOfPeople) { var randomNumber = Random.Next (2); if (randomNumber < numberOfPeople) { var people = PersonCreator.CreateAdults ((int)numberOfPeople); tile.AddPeople (people); } }
public void AddWaterToTile(GameTile tile, decimal amountOfWater) { var randomNumber = Random.Next (2); if (randomNumber < amountOfWater) { tile.Inventory [ItemType.Water] += amountOfWater; } }
public void AddTreesToTile(GameTile tile, decimal numberOfTrees) { var randomNumber = Random.Next (2); if (randomNumber < numberOfTrees) { var trees = PlantCreator.CreateTrees ((int)numberOfTrees); tile.AddTrees (trees); } }
public GameTile CreateTile() { var tile = new GameTile (World); return tile; }