예제 #1
0
        private void RandomizeRoom(char p)
        {
            Room temp;

            Room[] myAdjacentRooms;
            Random r = MyMap.r;
            int    count;

            do
            {
                count           = 0;
                temp            = new Room(MyMap.getRandomRoom());
                myAdjacentRooms = MyCave.loadCaveandRoom(temp.getDecimalForm());

                if (MyMap.randomizeCharacterRoom(temp.getIntegerForm(), myAdjacentRooms, p))
                {
                    count++;
                }
            } while (MyMap.isRoomNotOkay(temp, p));

            if (p == 'p')
            {
                MyMap.setPlayerRoom(temp);
                MyMap.addToExplored(temp);
            }
            else if (p == 'w')
            {
                MyMap.setWumpusRoom(temp.getIntegerForm());
            }
        }