private void BuildSmelterRoom(Tile center, GeneratorGroup group) { var offsets = new[] { new Point(1, 0), new Point(0, 1), new Point(-1, 0), new Point(0, -1) }; var offset = offsets.Pick(Random); int radius = Random.Next(3, 5); int smelterX = -Random.Next(radius - 1) + Random.Next(radius - 1); int smelterY = -Random.Next(radius - 1) + Random.Next(radius - 1); for (int x = -radius; x <= radius; x++) { for (int y = -radius; y <= radius; y++) { var tile = center.GetNeighbor(x, y); tile.Group = group; if (x == offset.X * radius && y == offset.Y * radius) { tile.Replace(new FloorCave()); } else if (x == smelterX && y == smelterY) { tile.Replace(new FloorCave()); tile.PlaceOn(new Smelter(this)); } else if (x <= -radius || y <= -radius || x >= radius || y >= radius) { tile.Replace(new WallBrick()); } else { tile.Replace(new FloorCave()); } } } }
public FloodPoint(Point position, GeneratorGroup group) { Position = position; Group = group; }
public string GetGroupID(GeneratorGroup group) { return(Groups.Reverse[group]); }
public void AddGroup(string id, GeneratorGroup group) { Groups.Add(id, group); }
public void ApplyPost(GeneratorGroup group) { ModifyGroupPost(group); }
public void ApplyPre(GeneratorGroup group) { ModifyGroupPre(group); }