-
Notifications
You must be signed in to change notification settings - Fork 0
/
apis.txt
53 lines (47 loc) · 1.9 KB
/
apis.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
cards:
- new (cards)
- all () - returns array of these cards
- getPPN () - returns a PPN string representation
- toString () - returns a plain string representation
- toUnicodeString () - returns a Unicode string representation
- getOriginal () - returns the original constructed list of cards
- getOriginalPPN () - returns the original PPN string representation
- toOriginalString () - returns the original plain string representation
- toOriginalUnicodeString () - returns the original Unicode string representation
pile (extends cards):
- new ()
- sort (config) - sort cards by config: e.g. {sorting: Pile.SORTING.SUITS, reversed: true}
deck (extends cards):
- new ()
- validate (cards) - STATIC checks if the passed cards are a valid deck
- isValid () - checks if it is valid
- restore (cards) - restore desk from given cards
- cut () - cut the deck
- shuffle () - shuffle the deck
- deal () - deal to 3 players and talon
card:
- new ()
- compare (c1, c2, trump) - STATIC compare two cards for trump
- beats (card, trump) - check if it beats given card for trump
- getters...
- value
- suit
- label
- ppn
- toString () - return cards two character representation
- toUnicodeString () - return cards value + unicode sign for suit
ppn:
- all () - get all cards PPN representations
- ppn (label) - get PPN representation for label
- ppns (labels) - get PPN representations for labels
- card (ppn) - get a Card instance for given PPN representation
- cards (ppns) - get Card instances for given PPN representations
suit:
- suit (label) - get suit for label
- isValid (label) - check if the label is valid
- toUnicode (suit) - return unicode sign for suit
- all () - get all suits array
value:
- value (label) - get value for label
- isValid (label) - check if the label is valid
- all () - get all values array