Esempio n. 1
0
        public StatusObject mineATreasureCard(Card c)
        {
            StatusObject retVal = new StatusObject(false);
            if (c == null)
            {
                return retVal;
            }
            if (this.trashesNeeded <= 0 || (!this.myHand.contains(CardMother.Copper()) && !this.myHand.contains(CardMother.Silver())))
            {
                retVal.setMinedCorrectly(true);
                this.trashesNeeded = 0;
                return retVal;
            }
            if (c.Equals(CardMother.Copper()) || c.Equals(CardMother.Silver()))
            {
                if (c.Equals(CardMother.Copper()))
                {
                    this.getHand().getHand().Remove(c);
                    this.getHand().getHand().Add(CardMother.Silver());
                    retVal.setMinedCorrectly(true);
                    this.trashesNeeded--;
                }

                else
                {
                    this.getHand().getHand().Remove(c);
                    this.getHand().getHand().Add(CardMother.Gold());
                    retVal.setMinedCorrectly(true);
                    this.trashesNeeded--;
                }
                if (this.trashesNeeded > 0)
                {
                    retVal.setMinedCorrectly(false);
                    retVal.setMineTreasure(true);
                }
                return retVal;
            }
            else
            {
                return retVal;
            }
        }
Esempio n. 2
0
 public static void mineATreasure(Player P, StatusObject o)
 {
     o.setMineTreasure(true);
     P.setTrashesNeeded(P.getTrashesNeeded() + 1);
 }