Beispiel #1
0
        public BoolResponseBox hotelCard(int playedCardID, Guid setOfPropertiesToAddHotelTo, Guid playerGuid, Guid gameLobbyGuid, Guid playfieldModelInstanceGuid)
        {
            PlayFieldModel lastState    = getPreviousState();
            PlayFieldModel currentState = getCurrentState();
            PlayFieldModel nextState    = null;
            PlayerModel    playerModelAtCurrentState = move.getPlayerModel(playerGuid, currentState);
            ActionCard     playedActionCard          = monopolyDeal.deck.getCardByID(playedCardID) as ActionCard;

            if (playedActionCard != null && checkIfCardInHand(playedActionCard, playerModelAtCurrentState) != null)
            {
                MoveInfo playHotel = new MoveInfo();
                playHotel.playerWhoseTurnItIs = currentState.guidOfPlayerWhosTurnItIs;
                playHotel.playerMakingMove    = playerGuid;
                playHotel.moveBeingMade       = TurnActionTypes.PlayActionCard;
                playHotel.idOfCardBeingUsed   = playedCardID;

                playHotel.actionCardActionType = ActionCardAction.Hotel;

                playHotel.guidFullSetWithHouseToAddHotelTo = setOfPropertiesToAddHotelTo;

                BoolResponseBox result = move.evaluateMove(lastState, currentState, nextState, playerModelAtCurrentState, playHotel.moveBeingMade, playHotel);
                return(result);
            }
            return(new BoolResponseBox(false, "Selected Card is not in players hand or is not a Action card"));
        }
Beispiel #2
0
        public BoolResponseBox forcedDealCard(int forcedDealCardID, int playersCardToSwapWith, Guid setPlayersCardIsIn, Guid targetedPlayerGuid, int targetedCard, Guid setTargetCardIn, Guid playerGuid, Guid gameLobbyGuid, Guid playfieldModelInstanceGuid)
        {
            PlayFieldModel lastState    = getPreviousState();
            PlayFieldModel currentState = getCurrentState();
            PlayFieldModel nextState    = null;
            PlayerModel    playerModelAtCurrentState = move.getPlayerModel(playerGuid, currentState);
            ActionCard     playedActionCard          = monopolyDeal.deck.getCardByID(forcedDealCardID) as ActionCard;
            PropertyCard   cardToForcedDealFor       = monopolyDeal.deck.getCardByID(targetedCard) as PropertyCard;
            PropertyCard   cardToLoseInForcedDeal    = monopolyDeal.deck.getCardByID(playersCardToSwapWith) as PropertyCard;

            if (playedActionCard != null && checkIfCardInHand(playedActionCard, playerModelAtCurrentState) != null && cardToForcedDealFor != null && cardToLoseInForcedDeal != null)
            {
                MoveInfo playForcedDeal = new MoveInfo();
                playForcedDeal.playerWhoseTurnItIs = currentState.guidOfPlayerWhosTurnItIs;
                playForcedDeal.playerMakingMove    = playerGuid;
                playForcedDeal.moveBeingMade       = TurnActionTypes.PlayActionCard;
                playForcedDeal.idOfCardBeingUsed   = forcedDealCardID;

                playForcedDeal.actionCardActionType = ActionCardAction.ForcedDeal;

                playForcedDeal.guidOfCardToBeForcedDealed         = cardToForcedDealFor.cardGuid;
                playForcedDeal.guidOfSetCardToBeForcedDealedIsIn  = setTargetCardIn;
                playForcedDeal.guidOfPlayerWhoIsBeingForcedDealed = targetedPlayerGuid;

                playForcedDeal.idOfCardToBeForcedDealed             = cardToForcedDealFor.cardID;
                playForcedDeal.idOfCardToBeGivenUpInForcedDeal      = cardToLoseInForcedDeal.cardID;
                playForcedDeal.guidOfCardToBeGivenUpInForcedDeal    = cardToLoseInForcedDeal.cardGuid;
                playForcedDeal.guidOfSetCardGivenUpInForcedDealIsIn = setPlayersCardIsIn;

                BoolResponseBox result = move.evaluateMove(lastState, currentState, nextState, playerModelAtCurrentState, playForcedDeal.moveBeingMade, playForcedDeal);
                return(result);
            }
            return(new BoolResponseBox(false, "Selected Card is not in players hand or is not a Action card"));
        }
Beispiel #3
0
        public BoolResponseBox dealBreakerCard(int dealBreakerCardID, Guid targetedPlayerGuid, Guid setTargeted, Guid playerGuid, Guid gameLobbyGuid, Guid playfieldModelInstanceGuid)
        {
            PlayFieldModel lastState    = getPreviousState();
            PlayFieldModel currentState = getCurrentState();
            PlayFieldModel nextState    = null;
            PlayerModel    playerModelAtCurrentState = move.getPlayerModel(playerGuid, currentState);
            ActionCard     playedActionCard          = monopolyDeal.deck.getCardByID(dealBreakerCardID) as ActionCard;

            if (playedActionCard != null && checkIfCardInHand(playedActionCard, playerModelAtCurrentState) != null)
            {
                MoveInfo playdealBreaker = new MoveInfo();
                playdealBreaker.playerWhoseTurnItIs = currentState.guidOfPlayerWhosTurnItIs;
                playdealBreaker.playerMakingMove    = playerGuid;
                playdealBreaker.moveBeingMade       = TurnActionTypes.PlayActionCard;
                playdealBreaker.idOfCardBeingUsed   = dealBreakerCardID;

                playdealBreaker.actionCardActionType = ActionCardAction.DealBreaker;

                playdealBreaker.guidOfFullSetToBeDealBreakered      = setTargeted;
                playdealBreaker.guidOfPlayerWhoIsBeingDealBreakered = targetedPlayerGuid;

                BoolResponseBox result = move.evaluateMove(lastState, currentState, nextState, playerModelAtCurrentState, playdealBreaker.moveBeingMade, playdealBreaker);
                return(result);
            }
            return(new BoolResponseBox(false, "Selected Card is not in players hand or is not a Action card"));
        }
Beispiel #4
0
        public BoolResponseBox standardRentCard(int playedCard, Guid setOfPropertiesToRentOn, bool usingDoubleTheRent, int doubleTheRentCard, Guid playerGuid, Guid gameLobbyGuid, Guid playfieldModelInstanceGuid)
        {
            PlayFieldModel lastState    = getPreviousState();
            PlayFieldModel currentState = getCurrentState();
            PlayFieldModel nextState    = null;
            PlayerModel    playerModelAtCurrentState = move.getPlayerModel(playerGuid, currentState);
            ActionCard     playedActionCard          = monopolyDeal.deck.getCardByID(playedCard) as ActionCard;

            if (playedActionCard != null && checkIfCardInHand(playedActionCard, playerModelAtCurrentState) != null)
            {
                MoveInfo playStandardRent = new MoveInfo();
                playStandardRent.playerWhoseTurnItIs = currentState.guidOfPlayerWhosTurnItIs;
                playStandardRent.playerMakingMove    = playerGuid;
                playStandardRent.moveBeingMade       = TurnActionTypes.PlayActionCard;
                playStandardRent.idOfCardBeingUsed   = playedCard;

                playStandardRent.actionCardActionType = ActionCardAction.RentStandard;

                playStandardRent.guidOfSetToCollectRentOn = setOfPropertiesToRentOn;

                playStandardRent.idOfDoubleTheRentCardBeingUsed = doubleTheRentCard;
                playStandardRent.isDoubleTheRentCardBeingUsed   = usingDoubleTheRent;

                BoolResponseBox result = move.evaluateMove(lastState, currentState, nextState, playerModelAtCurrentState, playStandardRent.moveBeingMade, playStandardRent);
                return(result);
            }
            return(new BoolResponseBox(false, "Selected Card is not in players hand or is not a Action card"));
        }
Beispiel #5
0
        public bool playActionCardPassGo(int passGoCardID, Guid serverGuid, Guid playerGuid, Guid playfieldModelInstanceGuid, TurnActionTypes turnActionTypes)
        {
            PlayFieldModel lastState    = getPreviousState();
            PlayFieldModel currentState = getCurrentState();
            PlayFieldModel nextState    = null;
            PlayerModel    playerModelAtCurrentState = move.getPlayerModel(playerGuid, currentState);
            ActionCard     playedPassGo = monopolyDeal.deck.getCardByID(passGoCardID) as ActionCard;

            if (playedPassGo != null && checkIfCardInHand(playedPassGo, playerModelAtCurrentState) != null)
            {
                MoveInfo playPassGo = new MoveInfo();
                playPassGo.playerWhoseTurnItIs  = playerGuid;
                playPassGo.playerMakingMove     = playerGuid;
                playPassGo.moveBeingMade        = TurnActionTypes.PlayActionCard;
                playPassGo.idOfCardBeingUsed    = passGoCardID;
                playPassGo.actionCardActionType = ActionCardAction.PassGo;

                BoolResponseBox result = move.evaluateMove(lastState, currentState, nextState, playerModelAtCurrentState, playPassGo.moveBeingMade, playPassGo);
                return(result.success);
            }
            return(new BoolResponseBox(false, "Selected Card is not in players hand or is not a Action Card").success);
        }
Beispiel #6
0
        public bool playActionCardItsMyBirthday(int myBirthdayCardID, Guid playerGuid, Guid gameLobbyGuid, Guid stateGuid)
        {
            PlayFieldModel lastState    = getPreviousState();
            PlayFieldModel currentState = getCurrentState();
            PlayFieldModel nextState    = null;
            PlayerModel    playerModelAtCurrentState = move.getPlayerModel(playerGuid, currentState);
            ActionCard     playedActionCard          = monopolyDeal.deck.getCardByID(myBirthdayCardID) as ActionCard;

            if (playedActionCard != null && checkIfCardInHand(playedActionCard, playerModelAtCurrentState) != null)
            {
                MoveInfo playBirthday = new MoveInfo();
                playBirthday.playerWhoseTurnItIs = currentState.guidOfPlayerWhosTurnItIs;
                playBirthday.playerMakingMove    = playerGuid;
                playBirthday.moveBeingMade       = TurnActionTypes.PlayActionCard;
                playBirthday.idOfCardBeingUsed   = myBirthdayCardID;

                playBirthday.actionCardActionType = ActionCardAction.ItsMyBirthday;

                BoolResponseBox result = move.evaluateMove(lastState, currentState, nextState, playerModelAtCurrentState, playBirthday.moveBeingMade, playBirthday);
                return(result.success);
            }
            return(new BoolResponseBox(false, "Selected Card is not in players hand or is not a Action card").success);
        }
 public void referenceAllDataContracts(ActionCard ac, Card c, FieldUpdateMessage fum, Message msg, MoneyCard mc, PlayerBank pb, PlayerHand ph, PlayerModel pm, PlayerPropertySets pps, PlayFieldModel pfm, PlayPile pp, PollForFieldUpdateMessage pffum, PropertyCard pc, PropertyCardSet pcs, PropertySetInfo psi, RentStandard rs, TakeActionOnTurnMessage taotm, TurnActionModel tam)
 {
     throw new NotImplementedException();
 }
        public override Card clone()
        {
            ActionCard clone = new ActionCard(this.actionType, this.cardValue, this.cardName, this.cardText, this.cardID, this.cardGuid, this.description, this.MonetaryValueOnly);

            return(clone);
        }
 public override Card clone()
 {
     ActionCard clone = new ActionCard(this.actionType, this.cardValue, this.cardName, this.cardText, this.cardID, this.cardGuid, this.description, this.MonetaryValueOnly);
     return clone;
 }
 public void referenceAllDataContracts(ActionCard ac, Card c, FieldUpdateMessage fum, Message msg, MoneyCard mc, PlayerBank pb, PlayerHand ph, PlayerModel pm, PlayerPropertySets pps, PlayFieldModel pfm, PlayPile pp, PollForFieldUpdateMessage pffum, PropertyCard pc, PropertyCardSet pcs, PropertySetInfo psi, RentStandard rs, TakeActionOnTurnMessage taotm, TurnActionModel tam)
 {
     throw new NotImplementedException();
 }