예제 #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);
 }