public static GuidBox boxGuid(this Guid guid) { GuidBox gb = new GuidBox(); gb.guid = guid; return(gb); }
public bool setLobbyClientReady(GuidBox gameLobbyGuidP, GuidBox clientGuidP, bool readyP) { try { return(lobby.setLobbyClientReady(gameLobbyGuidP.guid, clientGuidP.guid, readyP)); } catch (Exception ex) { throw new FaultException(ex.Message); } }
public bool joinExistingGameLobby(GuidBox gameLobbyGuidP, GuidBox clientGuidP) { try { return(lobby.joinExistingGameLobby(gameLobbyGuidP.guid, clientGuidP.guid)); } catch (Exception) { return(false); } }
public bool checkIfGameStarted(GuidBox gameLobbyGuidP) { try { return(lobby.checkIfGameStarted(gameLobbyGuidP.guid)); } catch (Exception ex) { throw new FaultException(ex.Message); } }
public GuidBox joinNewGameLobby(GuidBox clientGuidP) { try { return(lobby.joinNewGameLobby(clientGuidP.guid).boxGuid()); } catch (Exception ex) { throw new FaultException(ex.Message); } }
public bool exitGameLobby(GuidBox clientGuidP) { try { return(lobby.exitGameLobby(clientGuidP.guid)); } catch (Exception ex) { throw new FaultException(ex.Message); } }
public GameLobbyStatus getGameLobbyStatus(GuidBox gameLobbyGuidP) { try { return(lobby.getGameLobbyStatus(gameLobbyGuidP.guid)); } catch (Exception) { return(GameLobbyStatus.Full); } }
public GuidBox connectToLobby(string name) { try { GuidBox success = lobby.connectToLobby(name).boxGuid(); return(success); } catch (Exception) { return(new GuidBox()); } }
public bool payCardsMD(GuidBox playerPaying, List <int> cardsToPayWith, GuidBox gameLobbyGuid, GuidBox serverGuid, GuidBox playfieldModelInstanceGuid, GuidBox turnActionGuid) { //Find MonopolyDealGame MonopolyDeal md = getMonopolyDeal(gameLobbyGuid.guid); if (md != null) { return(md.getMonopolyDealGameStateManager().payDebt(cardsToPayWith, playerPaying.guid, gameLobbyGuid.guid, playfieldModelInstanceGuid.guid)); } else { return(false); } }
public bool playActionCardDebtCollectorMD(int debtCollectorCardID, GuidBox targetedPlayerGuid, GuidBox playerGuid, GuidBox gameLobbyGuid, GuidBox playfieldModelInstanceGuid) { //Find MonopolyDealGame MonopolyDeal md = getMonopolyDeal(gameLobbyGuid.guid); if (md != null) { return(md.getMonopolyDealGameStateManager().playDebtCollector(debtCollectorCardID, targetedPlayerGuid.guid, playerGuid.guid, gameLobbyGuid.guid, playfieldModelInstanceGuid.guid)); } else { return(false); } }
public bool playActionCardItsMyBirthdayMD(int myBirthdayCardID, GuidBox playerGuid, GuidBox gameLobbyGuid, GuidBox playfieldModelInstanceGuid) { //Find MonopolyDealGame MonopolyDeal md = getMonopolyDeal(gameLobbyGuid.guid); if (md != null) { return(md.getMonopolyDealGameStateManager().playActionCardItsMyBirthday(myBirthdayCardID, playerGuid.guid, gameLobbyGuid.guid, playfieldModelInstanceGuid.guid)); } else { return(false); } }
public bool playJustSayNoMD(int playedCard, GuidBox playerGuid, GuidBox gameLobbyGuid, GuidBox playfieldModelInstanceGuid) { //Find MonopolyDealGame MonopolyDeal md = getMonopolyDeal(gameLobbyGuid.guid); if (md != null) { return(md.getMonopolyDealGameStateManager().playActionCardJustSayNo(playedCard, playerGuid.guid, gameLobbyGuid.guid, playfieldModelInstanceGuid.guid)); } else { return(false); } }
public BoolResponseBox playHotelMD(int playedCardID, GuidBox setOfPropertiesToAddHotelTo, GuidBox playerGuid, GuidBox gameLobbyGuid, GuidBox playfieldModelInstanceGuid) { //Find MonopolyDealGame MonopolyDeal md = getMonopolyDeal(gameLobbyGuid.guid); if (md != null) { return(md.getMonopolyDealGameStateManager().hotelCard(playedCardID, setOfPropertiesToAddHotelTo.guid, playerGuid.guid, gameLobbyGuid.guid, playfieldModelInstanceGuid.guid)); } else { return(new BoolResponseBox(false, "Can not find game")); } }
public BoolResponseBox doNotPlayJustSayNoMD(GuidBox playerGuid, GuidBox gameLobbyGuid, GuidBox playfieldModelInstanceGuid) { //Find MonopolyDealGame MonopolyDeal md = getMonopolyDeal(gameLobbyGuid.guid); if (md != null) { return(md.getMonopolyDealGameStateManager().doNotJustSayNo(playerGuid.guid, gameLobbyGuid.guid, playfieldModelInstanceGuid.guid)); } else { return(new BoolResponseBox(false, "Can not find game")); } }
public BoolResponseBox playActionCardDealBreakerMD(int dealBreakerCardID, GuidBox targetedPlayerGuid, GuidBox setTargeted, GuidBox playerGuid, GuidBox gameLobbyGuid, GuidBox playfieldModelInstanceGuid) { //Find MonopolyDealGame MonopolyDeal md = getMonopolyDeal(gameLobbyGuid.guid); if (md != null) { return(md.getMonopolyDealGameStateManager().dealBreakerCard(dealBreakerCardID, targetedPlayerGuid.guid, setTargeted.guid, playerGuid.guid, gameLobbyGuid.guid, playfieldModelInstanceGuid.guid)); } else { return(new BoolResponseBox(false, "Can not find game")); } }
public BoolResponseBox playStandardRentActionCardOnTurnMD(int playedCard, GuidBox setOfPropertiesToRentOn, bool usingDoubleTheRent, int doubleTheRentCard, GuidBox playerGuid, GuidBox gameLobbyGuid, GuidBox playfieldModelInstanceGuid) { //Find MonopolyDealGame MonopolyDeal md = getMonopolyDeal(gameLobbyGuid.guid); if (md != null) { return(md.getMonopolyDealGameStateManager().standardRentCard(playedCard, setOfPropertiesToRentOn.guid, usingDoubleTheRent, doubleTheRentCard, playerGuid.guid, gameLobbyGuid.guid, playfieldModelInstanceGuid.guid)); } else { return(new BoolResponseBox(false, "Can not find game")); } }
public BoolResponseBox movePropertyCardMD(int propertyCardToMoveID, bool isCardUp, bool moveToExistiongSet, GuidBox oldSetGuid, GuidBox setToPlayPropertyToGuid, GuidBox playerGuid, GuidBox gameLobbyGuid, GuidBox playfieldModelInstanceGuid) { //Find MonopolyDealGame MonopolyDeal md = getMonopolyDeal(gameLobbyGuid.guid); if (md != null) { return(md.getMonopolyDealGameStateManager().movePropertyCard(propertyCardToMoveID, isCardUp, moveToExistiongSet, oldSetGuid.guid, setToPlayPropertyToGuid.guid, playerGuid.guid, gameLobbyGuid.guid, playfieldModelInstanceGuid.guid)); } else { return(new BoolResponseBox(false, "Can not find game")); } }
public bool draw5AtStartOfTurnMD(GuidBox playerGuid, GuidBox gameLobbyGuid, GuidBox playfieldModelInstanceGuid) { try { //Find MonopolyDealGame MonopolyDeal md = getMonopolyDeal(gameLobbyGuid.guid); if (md != null) { return(md.getMonopolyDealGameStateManager().drawFiveCards(playerGuid.guid, playfieldModelInstanceGuid.guid).success); } else { return(false); } } catch (System.ServiceModel.CommunicationException ex) { throw new FaultException(ex.Message); } }
public bool discardMD(int cardsToDiscardIDs, GuidBox playerGuid, GuidBox gameLobbyGuid, GuidBox playfieldModelInstanceGuid) { try { //Find MonopolyDealGame MonopolyDeal md = getMonopolyDeal(gameLobbyGuid.guid); if (md != null) { return(md.getMonopolyDealGameStateManager().discard(cardsToDiscardIDs, playerGuid.guid, gameLobbyGuid.guid, playfieldModelInstanceGuid.guid)); } else { return(false); } } catch (System.ServiceModel.CommunicationException ex) { throw new FaultException(ex.Message); } }
public bool playActionCardPassGoMD(int passGoCardID, GuidBox playerGuid, GuidBox gameLobbyGuid, GuidBox playfieldModelInstanceGuid) { try { //Find MonopolyDealGame MonopolyDeal md = getMonopolyDeal(gameLobbyGuid.guid); if (md != null) { return(md.getMonopolyDealGameStateManager().playActionCardPassGo(passGoCardID, gameLobbyGuid.guid, playerGuid.guid, playfieldModelInstanceGuid.guid, TurnActionTypes.PlayActionCard)); } else { return(false); } } catch (System.ServiceModel.CommunicationException ex) { throw new FaultException(ex.Message); } }
/// <summary> /// Clients call this method to bank a card on their turn. /// </summary> /// <param name="playedCardID"></param> /// <param name="playerGuid"></param> /// <param name="gameLobbyGuid"></param> /// <param name="playfieldModelInstanceGuid"></param> /// <param name="turnActionGuid"></param> /// <returns></returns> public bool playCardFromHandToBankMD(int playedCardID, GuidBox playerGuid, GuidBox gameLobbyGuid, GuidBox playfieldModelInstanceGuid, GuidBox turnActionGuid) { try { //Find MonopolyDealGame MonopolyDeal md = getMonopolyDeal(gameLobbyGuid.guid); if (md != null) { return(md.getMonopolyDealGameStateManager().bankCard(playedCardID, playerGuid.guid, gameLobbyGuid.guid, playfieldModelInstanceGuid.guid)); } else { return(false); } } catch (Exception) { return(false); } }
public bool playPropertyCardNewSetMD(int playedCardID, bool isOrientedUp, GuidBox playerGuid, GuidBox gameLobbyGuid, GuidBox playfieldModelInstanceGuid) { try { //Find MonopolyDealGame MonopolyDeal md = getMonopolyDeal(gameLobbyGuid.guid); if (md != null) { return(md.getMonopolyDealGameStateManager().playPropertyCardToNewSet(gameLobbyGuid.guid, isOrientedUp, playerGuid.guid, playfieldModelInstanceGuid.guid, TurnActionTypes.PlayPropertyCard_New_Set, playedCardID)); } else { return(false); } } catch (System.ServiceModel.CommunicationException ex) { throw new FaultException(ex.Message); } }
/// <summary> /// Clients call this method to draw 2 cards at the start of their turn. /// </summary> /// <param name="playerGuid"></param> /// <param name="gameLobbyGuid"></param> /// <param name="playfieldModelInstanceGuid"></param> /// <param name="turnActionGuid"></param> /// <returns></returns> public bool draw2AtStartOfTurnMD(GuidBox playerGuid, GuidBox gameLobbyGuid, GuidBox playfieldModelInstanceGuid, GuidBox turnActionGuid) { try { //Find MonopolyDealGame MonopolyDeal md = getMonopolyDeal(gameLobbyGuid.guid); if (md != null) { BoolResponseBox result = md.getMonopolyDealGameStateManager().drawTwoCardsAtTurnStart(playerGuid.guid, playfieldModelInstanceGuid.guid); return(result.success); } else { return(new BoolResponseBox(false, "Unable to find game with specified Guid").success); } } catch (Exception) { return(false); } }
/// <summary> /// Gets the current state of a Monopoly Deal Game on service hiding cards of other players /// </summary> /// <param name="playerGuid">Guid of player</param> /// <param name="gameGuid">Guid of MonopolyDeal game instance</param> /// <returns>PlayFieldModel of current state</returns> public PlayFieldModel pollStateMonopolyDealPerPlayer(GuidBox playerGuid, GuidBox gameGuid) { try { //Find MonopolyDealGame MonopolyDeal md = getMonopolyDeal(gameGuid.guid); if (md != null) { //Ask GameStateManager for currentState PlayFieldModel currentState = md.getMonopolyDealGameStateManager().getCurrentState(); //TODO:Current state should be filtered here so players cant see other players hands //TODO:Could send Acknowledgement at this point but currently will have client send Acknowledgement return(currentState); } else { return(null); } } catch (System.ServiceModel.CommunicationException ex) { throw new FaultException(ex.Message); } }
public bool playPropertyCardMD(PlayerModel player, Card playedCard, PropertyCardSet setToPlayPropertyTo, GuidBox playerGuid, GuidBox gameLobbyGuid, GuidBox playfieldModelInstanceGuid, GuidBox turnActionGuid) { try { //Find MonopolyDealGame MonopolyDeal md = getMonopolyDeal(gameLobbyGuid.guid); if (md != null) { return(md.getMonopolyDealGameStateManager().playPropertyCardToExistingSet(playedCard, setToPlayPropertyTo, gameLobbyGuid.guid, playerGuid.guid, playfieldModelInstanceGuid.guid)); } else { return(false); } } catch (System.ServiceModel.CommunicationException ex) { throw new FaultException(ex.Message); } }
public bool hasGameStartedMD(GuidBox playerGuid, GuidBox gameLobbyGuid) { throw new NotImplementedException(); }
public BoolResponseBox playActionCardForcedDealMD(int forcedDealCardID, int playersCardToSwapWith, GuidBox setPlayersCardIsIn, GuidBox targetedPlayerGuid, int targetedCard, GuidBox setTargetCardIn, GuidBox playerGuid, GuidBox gameLobbyGuid, GuidBox playfieldModelInstanceGuid) { //Find MonopolyDealGame MonopolyDeal md = getMonopolyDeal(gameLobbyGuid.guid); if (md != null) { return(md.getMonopolyDealGameStateManager().forcedDealCard(forcedDealCardID, playersCardToSwapWith, setPlayersCardIsIn.guid, targetedPlayerGuid.guid, targetedCard, setTargetCardIn.guid, playerGuid.guid, gameLobbyGuid.guid, playfieldModelInstanceGuid.guid)); } else { return(new BoolResponseBox(false, "Can not find game")); } }