private Farmyard( ImmutableList <FarmyardEntity> grid, ImmutableArray <int[]> pastures, ImmutableList <int> fences, AnimalManager animalManager, HouseType houseType) { this.Pastures = pastures; this.Grid = grid; this.Fences = fences; this.AnimalManager = animalManager; this.HouseType = houseType; }
public Farmyard() { HouseType = HouseType.Wood; var gridBuilder = new List <FarmyardEntity>(); for (var x = 0; x < WIDTH; x++) { for (var y = 0; y < HEIGHT; y++) { gridBuilder.Add(new Empty(x, y)); } } Fences = ImmutableList <int> .Empty; Pastures = ImmutableArray <int[]> .Empty; AnimalManager = new AnimalManager(); Grid = gridBuilder.ToImmutableList(); }
public Farmyard RemoveAnimals(AnimalResource type, int count) { return(new Farmyard(Grid, Pastures, Fences, AnimalManager.RemoveAnimals(type, count), HouseType)); }
public Farmyard AssignAnimals(AnimalHousingData[] assignments) { return(new Farmyard(Grid, Pastures, Fences, AnimalManager.AssignAnimals(assignments), HouseType)); }
public Farmyard UpdateAnimalManager(AnimalHousingData[] animalAssignments) { return(new Farmyard(Grid, Pastures, Fences, AnimalManager.Update(this.Grid, this.Pastures, animalAssignments), HouseType)); }
/// <summary> /// Updates the animal manager. /// </summary> public Farmyard UpdateAnimalManager() { return(new Farmyard(Grid, Pastures, Fences, AnimalManager.Update(this.Grid, this.Pastures), HouseType)); }
public int AnimalCount(AnimalResource Type) { return(AnimalManager.GetAnimalCount(Type)); }