public bool checkIfGameStarted(GuidBox gameLobbyGuidP)
 {
     try
     {
         return lobby.checkIfGameStarted(gameLobbyGuidP.guid);
     }
     catch (Exception ex)
     {
         throw new FaultException(ex.Message);
     }
 }
 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 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 BoolResponseBox playActionCardSlyDealMD(int slyDealCardID, 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().slyDealCard(slyDealCardID, targetedPlayerGuid.guid, targetedCard, setTargetCardIn.guid, playerGuid.guid, gameLobbyGuid.guid, playfieldModelInstanceGuid.guid);
     }
     else
     {
         return new BoolResponseBox(false, "Can not find game");
     }
 }
 /// <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 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);
     }
 }
 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 GuidBox joinNewGameLobby(GuidBox clientGuidP)
 {
     try
     {
         return lobby.joinNewGameLobby(clientGuidP.guid).boxGuid();
     }
     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 hasGameStartedMD(GuidBox playerGuid, GuidBox gameLobbyGuid)
 {
     throw new NotImplementedException();
 }
 public GameLobbyStatus getGameLobbyStatus(GuidBox gameLobbyGuidP)
 {
     try
     {
         return lobby.getGameLobbyStatus(gameLobbyGuidP.guid);
     }
     catch (Exception)
     {
         return GameLobbyStatus.Full;
     }
 }
 public bool exitGameLobby(GuidBox clientGuidP)
 {
     try
     {
         return lobby.exitGameLobby(clientGuidP.guid);
     }
     catch (Exception ex)
     {
         throw new FaultException(ex.Message);
     }
 }
 public bool endTurnMD(GuidBox playerGuid, GuidBox gameLobbyGuid, GuidBox playfieldModelInstanceGuid)
 {
     try
     {
         //Find MonopolyDealGame
         MonopolyDeal md = getMonopolyDeal(gameLobbyGuid.guid);
         if (md != null)
         {
             return md.getMonopolyDealGameStateManager().endTurn(playerGuid.guid, playfieldModelInstanceGuid.guid).success;
         }
         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 BoolResponseBox playHouseMD(int playedCardID, GuidBox setOfPropertiesToAddHouseTo, GuidBox playerGuid, GuidBox gameLobbyGuid, GuidBox playfieldModelInstanceGuid)
 {
     //Find MonopolyDealGame
     MonopolyDeal md = getMonopolyDeal(gameLobbyGuid.guid);
     if (md != null)
     {
         return md.getMonopolyDealGameStateManager().houseCard(playedCardID, setOfPropertiesToAddHouseTo.guid, 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 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 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 BoolResponseBox playWildRentActionCardOnTurnMD(int playedCardID, GuidBox playerTargetedGuid, GuidBox setOfPropertiesToRentOnGuid, bool usingDoubleTheRent, int doubleTheRentCard, GuidBox playerGuid, GuidBox gameLobbyGuid, GuidBox playfieldModelInstanceGuid)
 {
     //Find MonopolyDealGame
     MonopolyDeal md = getMonopolyDeal(gameLobbyGuid.guid);
     if (md != null)
     {
         return md.getMonopolyDealGameStateManager().wildRentCard(playedCardID, playerTargetedGuid.guid, setOfPropertiesToRentOnGuid.guid, usingDoubleTheRent, doubleTheRentCard, playerGuid.guid, gameLobbyGuid.guid, playfieldModelInstanceGuid.guid);
     }
     else
     {
         return new BoolResponseBox(false, "Can not find game");
     }
 }
 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 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 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 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);
     }
 }
예제 #25
0
 public static GuidBox boxGuid(this Guid guid)
 {
     GuidBox gb = new GuidBox();
     gb.guid = guid;
     return gb;
 }