예제 #1
0
    private void purchaseCard(Card c)
    {
        //TODO: Buy card if have enough power,
        //is in the line up
        //and not hand
        //Not Owned
        //TODO: Not FaceDown
        //TODO: Clean Code
        Card_Logic logic = c.getCardLogic();

        if (!Hand.Contains(c) && !logic.getOwned() && logic.IsInPurchaseArea() && logic.IsInLineUp() && PlaySystem.getCurrentPlayer() == this)
        {
            //Add to discard Pile and Remove from line Up list and set ownership to player
            //TEMP? Need If here to check if you release the mouse button then you buy it rather than just when you hover over a player
            if (Input.GetMouseButtonUp(0))
            {
                c.getCardLogic().setPlayerOwned(this);
                DiscardCard(c);
                Play_Board.RemoveFromLineUp(c);
            }
        }
    }
예제 #2
0
 private void Awake()
 {
     logic = GetComponent <Card_Logic>();
 }