예제 #1
0
        public static GuidBox boxGuid(this Guid guid)
        {
            GuidBox gb = new GuidBox();

            gb.guid = guid;
            return(gb);
        }
예제 #2
0
 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);
     }
 }
예제 #3
0
 public bool joinExistingGameLobby(GuidBox gameLobbyGuidP, GuidBox clientGuidP)
 {
     try
     {
         return(lobby.joinExistingGameLobby(gameLobbyGuidP.guid, clientGuidP.guid));
     }
     catch (Exception)
     {
         return(false);
     }
 }
예제 #4
0
 public bool checkIfGameStarted(GuidBox gameLobbyGuidP)
 {
     try
     {
         return(lobby.checkIfGameStarted(gameLobbyGuidP.guid));
     }
     catch (Exception ex)
     {
         throw new FaultException(ex.Message);
     }
 }
예제 #5
0
 public GuidBox joinNewGameLobby(GuidBox clientGuidP)
 {
     try
     {
         return(lobby.joinNewGameLobby(clientGuidP.guid).boxGuid());
     }
     catch (Exception ex)
     {
         throw new FaultException(ex.Message);
     }
 }
예제 #6
0
 public bool exitGameLobby(GuidBox clientGuidP)
 {
     try
     {
         return(lobby.exitGameLobby(clientGuidP.guid));
     }
     catch (Exception ex)
     {
         throw new FaultException(ex.Message);
     }
 }
예제 #7
0
 public GameLobbyStatus getGameLobbyStatus(GuidBox gameLobbyGuidP)
 {
     try
     {
         return(lobby.getGameLobbyStatus(gameLobbyGuidP.guid));
     }
     catch (Exception)
     {
         return(GameLobbyStatus.Full);
     }
 }
예제 #8
0
 public GuidBox connectToLobby(string name)
 {
     try
     {
         GuidBox success = lobby.connectToLobby(name).boxGuid();
         return(success);
     }
     catch (Exception)
     {
         return(new GuidBox());
     }
 }
예제 #9
0
        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);
            }
        }
예제 #10
0
        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);
            }
        }
예제 #11
0
        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);
            }
        }
예제 #12
0
        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);
            }
        }
예제 #13
0
        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"));
            }
        }
예제 #14
0
        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"));
            }
        }
예제 #15
0
        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"));
            }
        }
예제 #16
0
        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"));
            }
        }
예제 #17
0
        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"));
            }
        }
예제 #18
0
 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);
     }
 }
예제 #19
0
 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);
     }
 }
예제 #20
0
 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);
     }
 }
예제 #21
0
 /// <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);
     }
 }
예제 #22
0
 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);
     }
 }
예제 #23
0
 /// <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);
     }
 }
예제 #24
0
 /// <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);
     }
 }
예제 #25
0
 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);
     }
 }
예제 #26
0
 public bool hasGameStartedMD(GuidBox playerGuid, GuidBox gameLobbyGuid)
 {
     throw new NotImplementedException();
 }
예제 #27
0
        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"));
            }
        }