コード例 #1
0
ファイル: Room.cs プロジェクト: guild-gamers/ONEIRIC
    public void DrawOnHiddenScreen()
    {
        for (int row = 0; row < mapHeight; row++)
        {
            for (int col = 0; col < mapWidth; col++)
            {
                int posX = col * tileWidth + leftMargin;
                int posY = row * tileHeight + topMargin;
                switch (mapData[col, row])
                {
                case 'A': SdlHardware.DrawHiddenImage(images[0], posX,
                                                      posY); break;

                case 'W':
                    SdlHardware.DrawHiddenImage(images[1], posX,
                                                posY); break;

                case 'R':
                    SdlHardware.DrawHiddenImage(images[4], posX,
                                                posY); break;

                case 'P':
                    SdlHardware.DrawHiddenImage(images[5], posX,
                                                posY); break;

                case 'I':
                    SdlHardware.DrawHiddenImage(images[11], posX,
                                                posY); break;

                case 'D':
                    SdlHardware.DrawHiddenImage(images[10], posX,
                                                posY); break;

                case 'H':
                    SdlHardware.DrawHiddenImage(images[9], posX,
                                                posY); break;

                case 'V':
                    SdlHardware.DrawHiddenImage(images[8], posX,
                                                posY); break;

                case 'L':
                    SdlHardware.DrawHiddenImage(images[13], posX,
                                                posY); break;

                case 'J':
                    SdlHardware.DrawHiddenImage(images[12], posX,
                                                posY); break;

                case 'C':
                    mapData[col, row] = 'T';
                    SdlHardware.DrawHiddenImage(images[0], posX,
                                                posY);
                    SdlHardware.DrawHiddenImage(images[2], posX,
                                                posY);
                    Chest c = new Chest("data/images/map/computerOff.png", 1);
                    c.MoveTo(posX, posY);
                    chests.Add(c);
                    break;

                case 'T':
                    SdlHardware.DrawHiddenImage(images[0], posX,
                                                posY);
                    SdlHardware.DrawHiddenImage(images[2], posX,
                                                posY);
                    break;
                }
            }
        }
        foreach (Chest c in chests)
        {
            c.DrawOnHiddenScreen();
        }
    }