예제 #1
0
        public static void LogRoomLayout(PrototypeDungeonRoom room)
        {
            int    width  = room.Width;
            int    height = room.Height;
            string layout = string.Empty;

            for (int Y = height; Y > 0; Y--)
            {
                for (int X = 0; X < width; X++)
                {
                    CellType cellData = room.GetCellDataAtPoint(X, Y - 1).state;
                    if (cellData == null)
                    {
                        layout += "X";
                    }
                    else if (cellData == CellType.FLOOR)
                    {
                        layout += '-';
                    }
                    else if (cellData == CellType.WALL)
                    {
                        layout += 'W';
                    }
                    else if (cellData == CellType.PIT)
                    {
                        layout += 'P';
                    }
                    if (X == width - 1 && Y != 0)
                    {
                        layout += "\n";
                    }
                }
            }
            LogRoomToFile(layout, room.name + "_layout.txt");
        }