예제 #1
0
 //updates InGameRenderInfo render - UI uses this to know what to display
 public InGameRenderInfo updateRender()
 {
     //moves the Wumpus
     moveWumpus();
     //updates locations of hazards and player in render
     render.wumpusLocation = map.getWumpusLocation();
     int[] pitlocations = map.getBottomLessPitLocations();
     int[] batlocations = map.getBatsLocations();
     render.pitlocation1 = pitlocations[0];
     render.pitlocation2 = pitlocations[1];
     render.batlocation1 = batlocations[0];
     render.batlocation2 = batlocations[1];
     render.roomNum      = map.getPlayerLocation();
     //updates warnings to be displayed
     render.warnings = map.checkForHazards();
     //updates the current pathways that player can travel through
     render.currentPaths = map.getCurrentConnections(map.getPlayerLocation());
     //updates the inventory
     render.ArrowCount = player.getNumOfArrows();
     render.GoldCount  = player.getGold();
     //updates the player's score and the number turns
     render.numberOfTurns = player.getNumOfTurns();
     render.score         = player.playerScore();
     //returns the render info
     return(render);
 }