コード例 #1
0
ファイル: Form3.cs プロジェクト: tenghisu/Wumpus
        private void button2_Click(object sender, EventArgs e)
        {
            Wumpus wump = new Wumpus();

            wump.wumpusWakesUp(2, true);
            String wumpusWakesUp = wump.getWumpusState();

            textBox1.Text = wumpusWakesUp;
        }
コード例 #2
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);
        }
コード例 #3
0
        public GameControl()
        {
            wumpus = new Wumpus(); //int position, int turnsSinceWumpus, enum WumpusState state
            //UI = new UserInterface(); //????
            map    = new Map();    //roomNumberPlayer, roomNumberWumpus, roomNumberPit1, roomNumberPit2
            trivia = new Trivia(); //TriviaList, A-D, AnswerList
            cave   = new Cave();
            player = new Player(); //arrows, coins, turns, playersPosition, highScore (all int)

            alive           = true;
            questionNumbers = 10; //current number of questions in text file
            questionsRight  = new List <bool>();
            int questionsCorrect = 0;
        }
コード例 #4
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
        }
コード例 #5
0
ファイル: Form3.cs プロジェクト: tenghisu/Wumpus
 public Form3()
 {
     InitializeComponent();
     Wumpus wump = new Wumpus();
 }