public PlayFieldModel(Guid previousPlayFieldModelGuidP, Guid thisInstanceGuid, List <PlayerModel> playerModelsP, List <Card> topCardsPlayPileP, Guid guidOfPlayerWhosTurnItIsP, List <Guid> playersAffectedByActionCardGuidsP, TurnActionModel lastActionP, TurnActionModel nextActionP, DrawPile currentDrawPileState, PlayPile currentPlayPileState, int numberOfTurnsRemainingForPlayerP, bool startOfATurnP, Statephase phaseP, Deck deckP) { //The guid of this instance of PlayFieldModel thisPlayFieldModelInstanceGuid = thisInstanceGuid; //The Players playerModels = playerModelsP; //The last 4 played cards topCardsOnPlaypile = topCardsPlayPileP; //The guid of the player whos turn it currently is guidOfPlayerWhosTurnItIs = guidOfPlayerWhosTurnItIsP; //A list of players who are affected by an action card that have just been played playersAffectedByActionCardGuids = playersAffectedByActionCardGuidsP; //The TurnActionModel of the last action lastActionPlayed = lastActionP; //The current State of the deck drawPile = currentDrawPileState; //The current State of the playpile playpile = currentPlayPileState; //The maximun number of cards that the player whos turn it is can play before their turn is over numberOfTurnsRemainingForPlayerWhosTurnItIs = numberOfTurnsRemainingForPlayerP; //This is the first move of a turn so the player whose turn it is should draw two cards startOfATurn = startOfATurnP; currentTurnActionModel = nextActionP; lastActionPlayed = lastActionP; //Current Phase currentPhase = phaseP; //Previous PlayFieldModelGuid previousPlayFieldModelGuid = previousPlayFieldModelGuidP; //Deck deck = deckP; }
private DrawPile generateInitialDrawPile(PlayPile pp) { //ShuffleDeck deck = new Deck(NUMBER_OF_DECKS); DrawPile dp = new DrawPile(deck.getDeck(), pp); return(dp); }
internal PlayPile clone(Deck deck) { PlayPile ppclone = new PlayPile(); foreach (Card c in this.playPile) { ppclone.playCardOnPile(deck.getCardByID(c.cardID)); } return ppclone; }
internal PlayPile clone(Deck deck) { PlayPile ppclone = new PlayPile(); foreach (Card c in this.playPile) { ppclone.playCardOnPile(deck.getCardByID(c.cardID)); } return(ppclone); }
private PlayFieldModel createInitialState(List <PlayerModel> players) { //guid for initial state Guid playFieldModelGuid = PlayFieldModel.generateplayFieldModelGuid(); //no cards to be shown as played in playpile List <Card> emptyTopPlayPile = new List <Card>(); //setFirstPlayerToHaveTurn(players); //set player 0 to be first to play //Guid firstPlayerGuid = players.ElementAt(FIRST_PLAYER).guid; //currentPlayerTurn = FIRST_PLAYER; Guid firstPlayerGuid = setFirstPlayerToHaveTurn(players); //no players can be affected by actioncards as none have been played List <Guid> noPlayersAffectedByActionCard = new List <Guid>(); //No actions have been taken List <TurnActionTypes> actionsAllowable = new List <TurnActionTypes>(); actionsAllowable.Add(TurnActionTypes.drawTwoCardsAtStartOfTurn); //Set players Allowable actions foreach (PlayerModel p in players) { p.actionsCurrentlyAllowed = new List <TurnActionTypes>(); if (p.guid.CompareTo(firstPlayerGuid) == 0) { //Player whos turn it is must draw TwoCards p.actionsCurrentlyAllowed.Add(TurnActionTypes.drawTwoCardsAtStartOfTurn); } } // TurnActionModel noActionsPlayedFirstPlayerToDraw = new TurnActionModel(this.playerIdLookup, this.gameModelGuid, playFieldModelGuid, generateTurnActionGuid(), actionsAllowable, TurnActionTypes.gameStarted, false); //create empty playpile initialPlayPile = new PlayPile(); //fill new drawpile DrawPile initialDrawPile = generateInitialDrawPile(initialPlayPile); //Deal players thier first five cards dealPlayersInitialFiveCards(players, initialDrawPile); //It is the start of a players turn bool turnStart = true; //put it all into the intial state PlayFieldModel state = new PlayFieldModel(playFieldModelGuid, players, emptyTopPlayPile, firstPlayerGuid, noPlayersAffectedByActionCard, null, noActionsPlayedFirstPlayerToDraw, initialDrawPile, initialPlayPile, NEW_TURN_NUMBER_OF_CARDS_PLAYABLE, turnStart, Statephase.Turn_Started_Draw_2_Cards, deck); //stateCreated currentState = state; return(state); }
private DrawPile setUpDrawPile(Deck deck, PlayPile playPile) { drawPile = new DrawPile(deck.getDeck(), playPile); return(drawPile); }
public PlayPile setUpPlaypile() { playPile = new PlayPile(); return(playPile); }
private DrawPile generateInitialDrawPile(PlayPile pp) { //ShuffleDeck deck = new Deck(NUMBER_OF_DECKS); DrawPile dp = new DrawPile(deck.getDeck(), pp); return dp; }
private PlayFieldModel createInitialState(List<PlayerModel> players) { //guid for initial state Guid playFieldModelGuid = PlayFieldModel.generateplayFieldModelGuid(); //no cards to be shown as played in playpile List<Card> emptyTopPlayPile = new List<Card>(); //setFirstPlayerToHaveTurn(players); //set player 0 to be first to play //Guid firstPlayerGuid = players.ElementAt(FIRST_PLAYER).guid; //currentPlayerTurn = FIRST_PLAYER; Guid firstPlayerGuid = setFirstPlayerToHaveTurn(players); //no players can be affected by actioncards as none have been played List<Guid> noPlayersAffectedByActionCard = new List<Guid>(); //No actions have been taken List<TurnActionTypes> actionsAllowable = new List<TurnActionTypes>(); actionsAllowable.Add(TurnActionTypes.drawTwoCardsAtStartOfTurn); //Set players Allowable actions foreach (PlayerModel p in players) { p.actionsCurrentlyAllowed = new List<TurnActionTypes>(); if (p.guid.CompareTo(firstPlayerGuid) == 0) { //Player whos turn it is must draw TwoCards p.actionsCurrentlyAllowed.Add(TurnActionTypes.drawTwoCardsAtStartOfTurn); } } // TurnActionModel noActionsPlayedFirstPlayerToDraw = new TurnActionModel(this.playerIdLookup, this.gameModelGuid, playFieldModelGuid, generateTurnActionGuid(), actionsAllowable, TurnActionTypes.gameStarted, false); //create empty playpile initialPlayPile = new PlayPile(); //fill new drawpile DrawPile initialDrawPile = generateInitialDrawPile(initialPlayPile); //Deal players thier first five cards dealPlayersInitialFiveCards(players, initialDrawPile); //It is the start of a players turn bool turnStart = true; //put it all into the intial state PlayFieldModel state = new PlayFieldModel(playFieldModelGuid, players, emptyTopPlayPile, firstPlayerGuid, noPlayersAffectedByActionCard, null, noActionsPlayedFirstPlayerToDraw, initialDrawPile, initialPlayPile, NEW_TURN_NUMBER_OF_CARDS_PLAYABLE, turnStart, Statephase.Turn_Started_Draw_2_Cards, deck); //stateCreated currentState = state; return state; }
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 DrawPile(List<Card> cards, PlayPile playPile) { drawPile = cards; this.playPile = playPile; }
public PlayFieldModel(Guid previousPlayFieldModelGuidP, Guid thisInstanceGuid, List<PlayerModel> playerModelsP, List<Card> topCardsPlayPileP, Guid guidOfPlayerWhosTurnItIsP, List<Guid> playersAffectedByActionCardGuidsP, TurnActionModel lastActionP, TurnActionModel nextActionP, DrawPile currentDrawPileState, PlayPile currentPlayPileState, int numberOfTurnsRemainingForPlayerP, bool startOfATurnP, Statephase phaseP, Deck deckP) { //The guid of this instance of PlayFieldModel thisPlayFieldModelInstanceGuid = thisInstanceGuid; //The Players playerModels = playerModelsP; //The last 4 played cards topCardsOnPlaypile = topCardsPlayPileP; //The guid of the player whos turn it currently is guidOfPlayerWhosTurnItIs = guidOfPlayerWhosTurnItIsP; //A list of players who are affected by an action card that have just been played playersAffectedByActionCardGuids = playersAffectedByActionCardGuidsP; //The TurnActionModel of the last action lastActionPlayed = lastActionP; //The current State of the deck drawPile = currentDrawPileState; //The current State of the playpile playpile = currentPlayPileState; //The maximun number of cards that the player whos turn it is can play before their turn is over numberOfTurnsRemainingForPlayerWhosTurnItIs = numberOfTurnsRemainingForPlayerP; //This is the first move of a turn so the player whose turn it is should draw two cards startOfATurn = startOfATurnP; currentTurnActionModel = nextActionP; lastActionPlayed = lastActionP; //Current Phase currentPhase = phaseP; //Previous PlayFieldModelGuid previousPlayFieldModelGuid = previousPlayFieldModelGuidP; //Deck deck = deckP; }
public DrawPile(List <Card> cards, PlayPile playPile) { drawPile = cards; this.playPile = playPile; }
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(); }
private DrawPile setUpDrawPile(Deck deck, PlayPile playPile) { drawPile = new DrawPile(deck.getDeck(), playPile); return drawPile; }
public PlayPile setUpPlaypile() { playPile = new PlayPile(); return playPile; }