コード例 #1
0
 public void TributeCard(int playerId, SmallCardController card)
 {
     IncreasePlayerResource(playerId, 9, 1); // gain 1 FOUNDATION
     CardViewerController.instance.HideFullSizeCard();
     Destroy(card.gameObject);
     UpdatePlayersResources();
 }
コード例 #2
0
 public void AddCardToContract(SmallCardController card)
 {
     if (card._card.fractionType > 0)
     {
         _playerBoardPanel.GetComponent <PlayerBoardPanelController>().AddCardToContractPanel(card);
     }
 }
コード例 #3
0
 public void PlunderCard(int playerId, SmallCardController card)
 {
     IncreasePlayerResource(playerId, 4, -1); // cost 1 PILLAGE
     foreach (int r in card._card.gain)
     {
         IncreasePlayerResource(playerId, r, 1);
     }
     CardViewerController.instance.HideFullSizeCard();
     Destroy(card.gameObject);
     UpdatePlayersResources();
     ChangePlayersTurn();
 }
コード例 #4
0
 public void AddCardToContract(int playerId, SmallCardController card)
 {
     if (card._card.fractionType > 0)
     {
         _playerControllers[playerId - 1].AddCardToContract(card);
         IncreasePlayerResource(playerId, 6, -1); // cost 1 FOOD
         IncreasePlayerResource(playerId, card._card.contract, 1);
         IncreasePlayerResourceInGrowthMatrix(playerId, card._card.contract, 1);
         CardViewerController.instance.HideFullSizeCard();
         UpdatePlayersResources();
         ChangePlayersTurn();
     }
 }
コード例 #5
0
 public void ShowFullSizeCard(SmallCardController card)
 {
     if (_isShowed)
     {
         Destroy(_fullSizeCard);
     }
     else
     {
         _isShowed = true;
     }
     _fullSizeCard = Instantiate(_fullSizeCardPrefab, _parent) as GameObject;
     _fullSizeCard.GetComponent <BigCardController> ().InitData(card);
 }
コード例 #6
0
    public void AddCardToBoard(SmallCardController card)
    {
        GameObject newParent;

        if (card._card.fractionType > 0)
        {
            newParent = _fractionDropzones[card._card.actionType - 1];
        }
        else
        {
            newParent = _defaultDropzones[card._card.actionType - 1];
        }
        card.transform.SetParent(newParent.transform);
    }
コード例 #7
0
 public void InitData(SmallCardController cardController)
 {
     _cardController = cardController;
     _card           = cardController._card;
     Debug.Log("check player turn");
     Debug.Log("playerId " + cardController._playerId);
     if (!GameController.instance.IsPlayerTurn(cardController._playerId))
     {
         Debug.Log("Is not player turn");
         foreach (Button b in GetComponentsInChildren <Button>())
         {
             b.gameObject.SetActive(false);
         }
     }
 }
コード例 #8
0
 public void AddCardToBoard(SmallCardController card)
 {
     _playerBoardPanel.GetComponent <PlayerBoardPanelController>().AddCardToBoard(card);
 }
コード例 #9
0
 public BigCardController(SmallCardController cardController, CardData card) : base(card)
 {
     _cardController = cardController;
 }
コード例 #10
0
 public void BuildCardREQ(int playerId, SmallCardController card)
 {
     Debug.Log("BuildCard " + playerId + " | " + card._card.ToString());
     Server.instance.BuildCardREQ(playerId, card._card.fractionType, card._card.cardId);
 }
コード例 #11
0
 public void AddCardToContractPanel(SmallCardController card)
 {
     card.transform.SetParent(_contractsPanel.transform);
     card.transform.Rotate(new Vector3(0, 0, 180));
 }