]> Pileus Git - ~andy/spades/blob - doc/classes.txt
Add IRC Service and update UI
[~andy/spades] / doc / classes.txt
1 /* Android Glue */
2 Main: extends Activity           // UI Code:
3   Handler   handler;             //   Commands sent to Main by UI
4   Messenger messenger;           //   though handler/messenger
5
6   bool onStart(); ...            //   Activity methods
7
8   void onButtonClick(); ...      //   Widget callbacks
9
10   void onRegister(task);         //   Set Task object on startup
11   void onConnect(void);          //   IRC connected
12   void onDisconnect(void);       //   IRC disconnected
13   void onMessage(msg);           //   IRC message received
14
15 Task: extends Service            // IRC connection as service:
16   bool onCreate(); ...           //   Service methods
17
18   void run();                    //   IRC Client Thread entry
19
20   Message send(String txt);      //   Send IRC message
21
22 Util:                            // Misc functions
23   void debug(String str);        //   Print to debug log
24
25 /* IRC Client Protocol */
26 Client:                          // IRC Client:
27   void connect(srv, nick, chan); //   Connect to server
28
29   Message send(String msg)       //   Send text as message
30   Message recv(void)             //   Blocking recv message
31
32 Message:                         // IRC Message:
33
34 /* Spades game */
35 Spades:
36   Valid setHand(Set<Card> hand);
37   Valid setPile(Set<Card> pile);
38   Valid canPlay(Person who, Card card);
39
40 /* OpenGL Graphics */
41 Cards:
42   void addBidListener(BidListener listener);
43   void addPassListener(PassListener listener);
44   void addLookListener(LookListener listener);
45   void addPlayListener(PlayListener listener);
46   void addTurnListener(TurnListener listener);
47
48   void bid(Person who, int bid);
49   void pass(Card card);
50   void show(Set<Card> hand);
51   void play(Person who, Card card);
52
53 /* Listeners */
54 void MsgListener(Message msg);
55
56 Valid BidListener(int bid);
57 Valid PassListener(Card card);
58 Valid LookListener(void);
59 Valid PlayListener(Card card);
60 Valid TurnListener(void);
61
62 /* Types */
63 Card:
64
65 Team:
66   - Player a;
67   - Player b;
68
69 Person:
70   - nickname
71
72 // vim: ft=java