public MODEL_Card setOverride(int cardId, int amount) throws XCFException { MODEL_Card card = cardMgr.getCard(cardId); if (card == null) throw new XCFException(cardId + " is not a registed card."); override = card; numOverrides = amount; return card; }
public MODEL_Card add(Integer cardId, int limit) throws XCFException { MODEL_Card card = cardMgr.getCard(cardId); if (card == null) throw new XCFException(cardId + " is not a registed card."); if ((cost + card.getCost()) > limit) { throw new XCFException( "You can't add " + card.getName() + ". You are out of action points."); } cost += card.getCost(); add(card); return card; }