public void Given_GetZone_When_WorldIsPopulated_Then_ReturnMinimallyPopulatedZone() { // Arrange Zone world = new Zone(0, 0); int sizeX = 10; int sizeY = 10; // Act world.Generate(sizeX, sizeY); var zone = world.GetZone(5, 5); // Assert Assert.AreNotEqual(ZoneType.None, zone.Type); }
public void Given_ZoneIn_When_WorldIsPopulated_Then_PopulateSubZoneAndReturnPopulatedZone() { // Arrange Zone world = new Zone(0, 0); int sizeX = 10; int sizeY = 10; // Act world.Generate(sizeX, sizeY); var zone = world.ZoneIn(x: 5,y: 5,sizeX: 10,sizeY: 10); var subZone = zone.GetZone(1,1); // Assert Assert.AreNotEqual(ZoneType.None, subZone.Type); }
public Zone ZoneIn(int x, int y, int sizeX, int sizeY, List<Actor> actorsZoning, Zone parentZone) { var result = this.GetZone(x, y); result.Parent = parentZone; result.Generate(sizeX, sizeY); // Add NonPlayer Actors // Assign Actor List result.Actors.AddRange(actorsZoning); return result; }