Пример #1
0
 public override void Rasterize(BitmapRasterizer <DungeonTile> rasterizer, Random rand)
 {
     rasterizer.Copy(LabTemplate.MapTemplate, template, Pos);
     LabTemplate.DrawSpiderWeb(rasterizer, Bounds, rand);
 }
Пример #2
0
        public override void Rasterize(BitmapRasterizer <DungeonTile> rasterizer, Random rand)
        {
            rasterizer.Copy(LabTemplate.MapTemplate, current.Bounds, Pos);

            if ((current.Flags & RoomFlags.Evil) == 0)
            {
                LabTemplate.CreateEnemies(rasterizer, Bounds, rand);
            }

            var         flags = current.Flags & RoomFlags.ConnectionMask;
            DungeonTile?tile  = null;

            switch (flags)
            {
            case RoomFlags.Conn_Floor:
                tile = new DungeonTile
                {
                    TileType = LabTemplate.LabFloor
                };
                break;

            case RoomFlags.Conn_Destructible:
                tile = new DungeonTile
                {
                    TileType = LabTemplate.LabFloor,
                    Object   = destWall
                };
                break;

            default:
                return;
            }

            foreach (var edge in Edges)
            {
                var direction = edge.Linkage.Direction;
                if (edge.RoomA != this)
                {
                    direction = direction.Reverse();
                }

                Point a, b;
                switch (direction)
                {
                case Direction.South:
                    a = new Point(edge.Linkage.Offset, Pos.Y + Height - 1);
                    b = new Point(a.X + 3, a.Y);
                    break;

                case Direction.North:
                    a = new Point(edge.Linkage.Offset, Pos.Y);
                    b = new Point(a.X + 3, a.Y);
                    break;

                case Direction.East:
                    a = new Point(Pos.X + Width - 1, edge.Linkage.Offset);
                    b = new Point(a.X, a.Y + 3);
                    break;

                case Direction.West:
                    a = new Point(Pos.X, edge.Linkage.Offset);
                    b = new Point(a.X, a.Y + 3);
                    break;

                default:
                    throw new ArgumentException();
                }
                rasterizer.DrawLine(a, b, tile.Value);
            }

            LabTemplate.DrawSpiderWeb(rasterizer, Bounds, rand);
        }