예제 #1
0
파일: Map.cs 프로젝트: tenghisu/Wumpus
        public Boolean isWumpusCloseToPlayer()
        {
            Wumpus  wumpus = new Wumpus();
            Player  player = new Player();
            Boolean warning;
            int     roomNumberWumpus = wumpus.getWumpusPosition();
            int     roomNumberPlayer = player.getPlayerPosition();

            if (roomNumberWumpus + 2 == roomNumberPlayer)
            {
                warning = true;
            }
            return(warning);
        }
예제 #2
0
파일: Map.cs 프로젝트: tenghisu/Wumpus
        public int wumpusLocation()
        {
            Wumpus      wumpus         = new Wumpus();
            int         wumpusPosition = wumpus.getWumpusPosition();
            WumpusState state          = wumpus.getWumpusState();
            int         movement       = 0;

            if (state == "asleep")
            {
                movement = 0;
            }
            else
            {
                movement = 1;
            }
            return(roomNumberWumpus + movement);
            // given the wumpus state I can make the wumpus move to a whole new room number
        }