diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/Deck.java | 19 | ||||
-rw-r--r-- | tools/Timer.java | 23 |
2 files changed, 42 insertions, 0 deletions
diff --git a/tools/Deck.java b/tools/Deck.java new file mode 100644 index 0000000..d2e4d0c --- /dev/null +++ b/tools/Deck.java @@ -0,0 +1,19 @@ +package mahjong.tools; + +import mahjong.aux.Card; +import mahjong.aux.set.CardSet; +import mahjong.aux.set.Set; + +/** + * Created by joe on 12/1/14. + */ +public class Deck { + static public Set generateDeck() + { + Set deck = new Set(); + for (int i=0; i<CardSet.cardTypeTotal;++i) + for (int cnt=0; cnt<4; ++cnt) + deck.add(new Card(CardSet.deckIds[i])); + return deck; + } +} diff --git a/tools/Timer.java b/tools/Timer.java new file mode 100644 index 0000000..08d8829 --- /dev/null +++ b/tools/Timer.java @@ -0,0 +1,23 @@ +package mahjong.tools; + +/** + * Created by joe on 12/2/14. + */ +public class Timer { + long st,ed; + + public void tick() + { + st=System.currentTimeMillis(); + } + + public void tock() + { + ed=System.currentTimeMillis(); + } + + public long elapse() + { + return ed-st; + } +} |