1 7 8 package poker.presentation.main; 9 10 import poker.Poker; 11 import poker.spec.GameManager; 12 13 import com.lutris.appserver.server.httpPresentation.HttpPresentation; 15 import com.lutris.appserver.server.httpPresentation.HttpPresentationComms; 16 import com.lutris.appserver.server.httpPresentation.HttpPresentationException; 17 import com.lutris.util.KeywordValueException; 18 import poker.Poker; 19 20 public class HousePresentation implements HttpPresentation { 21 22 23 public void run(HttpPresentationComms comms) 24 throws HttpPresentationException, KeywordValueException { 25 26 HouseHTML house; 27 house = (HouseHTML)comms.xmlcFactory.create(HouseHTML.class); 28 29 Poker mainApp = (Poker)comms.session.getSessionData().get("app"); 30 GameManager gameManager = mainApp.getGameManager(); 31 36 try{ 37 house.setTextHouseProfit(gameManager.getHouseProfit()); 38 house.setTextTotalBankrupt(gameManager.getTotalBankrupt()); 39 house.setTextTotalHandsDealt(gameManager.getTotalHandsDealt()); 40 house.setTextTotalHandsLost(gameManager.getTotalHandsLost()); 41 house.setTextTotalHandsWon(gameManager.getTotalHandsWon()); 42 house.setTextTotalPlayers(gameManager.getTotalPlayers()); 43 44 }catch (NullPointerException e){} 45 46 comms.response.writeDOM(house); 47 } 48 49 } 50 | Popular Tags |