Package net.coljac.pirates

Examples of net.coljac.pirates.Card


        it.remove();
      }
    }
    for(String line: lines) {
      String[] tokens = line.split("\t");
      Card treasure = new Treasure();
      treasure.setExpansion("Pirates of the " + tokens[1]);
      treasure.setName(tokens[3]);
      treasure.setPoints(0);
      treasure.setRarity(tokens[2]);
      treasure.setRules(tokens[4]);
      treasure.setNumber(tokens[0]);
      db.getCards().add(treasure);
    }

    db.save();
  }
View Full Code Here


    JTable aTable = (JTable) e.getSource();
    int row = aTable.rowAtPoint(e.getPoint());
    int col = aTable.columnAtPoint(e.getPoint());
    if (col > 1) return;
    boolean right = e.getButton() == MouseEvent.BUTTON3;
    final Card card = callback.getCardAtRow(row);
    if (col == 0) {
      card.setOwned(card.getOwned() + (right ? -1 : 1));
      if (card.getOwned() < 0) {
        card.setOwned(0);
      }
    } else if (col == 1) {
      card.setWanted(card.getWanted() + (right ? -1 : 1));
      if (card.getWanted() < 0) {
        card.setWanted(0);
      }
    }
    new Thread() {
      public void run() {
        ManagerMain.instance.db.save();
View Full Code Here

    Collections.sort(cards, this);
  }


  public int compare(Object o1, Object o2) {
    Card card1 = (Card) o1;
    Card card2 = (Card) o2;

    int criterion = 0;
    for (criterion = 0; criterion < sortOrder.length; criterion ++) {
      int result = compareCards(card1, card2, sortOrder[criterion]);
      if (result != 0) {
View Full Code Here

  public int compareCards(Card card1, Card card2, int criterion) {
    int c = criterion;
    if (c < 0) {
      c = Math.abs(c);
      Card temp = card1;
      card1 = card2;
      card2 = temp;
    }

    int result = 0;
View Full Code Here

TOP

Related Classes of net.coljac.pirates.Card

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.