CardType BuyCard(PlayerDeck deck) { if (deck.AmountOfCardsBought % PlayerDeck.DeckSize == 0) { deck.Shuffle(); } return(deck.BuyCard()); }
void Start() { var gameObjectFactory = new GameObjectFactory(cardPrefabMap, playerPrefab); var deployer = new Deployer(gameObjectFactory, arena, gameplayHUD); var gameActionFactory = new GameActionFactory(deployer); gameplayHUD.Setup(gestureRecognizer, arena); gameplayHUD.CreateCardSlots(PlayerHand.HandSize); HomePlayer = gameObjectFactory.CreatePlayer(Team.Home); VisitorPlayer = gameObjectFactory.CreatePlayer(Team.Visitor); HomePlayer.Setup(PlayerDeck.GetDummyDeck()); VisitorPlayer.Setup(PlayerDeck.GetDummyDeck()); Dealer.DealInitialCards(HomePlayer); Dealer.DealInitialCards(VisitorPlayer); matchReferee.Setup(gameActionFactory, players: new [] { HomePlayer, VisitorPlayer }); }
public void Setup(PlayerDeck deck) { Deck = deck; }