示例#1
0
        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());
                    }
                }
            }
        }
示例#2
0
 public FloodPoint(Point position, GeneratorGroup group)
 {
     Position = position;
     Group    = group;
 }
示例#3
0
 public string GetGroupID(GeneratorGroup group)
 {
     return(Groups.Reverse[group]);
 }
示例#4
0
 public void AddGroup(string id, GeneratorGroup group)
 {
     Groups.Add(id, group);
 }
示例#5
0
 public void ApplyPost(GeneratorGroup group)
 {
     ModifyGroupPost(group);
 }
示例#6
0
 public void ApplyPre(GeneratorGroup group)
 {
     ModifyGroupPre(group);
 }