2 Main: extends Activity // UI Code:
3 Handler handler; // Commands sent to Main by UI
4 Messenger messenger; // though handler/messenger
6 bool onStart(); ... // Activity methods
8 void onButtonClick(); ... // Widget callbacks
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
15 Task: extends Service // IRC connection as service:
16 bool onCreate(); ... // Service methods
18 void run(); // IRC Client Thread entry
20 Message send(String txt); // Send IRC message
22 Util: // Misc functions
23 void debug(String str); // Print to debug log
25 /* IRC Client Protocol */
26 Client: // IRC Client:
27 void connect(srv, nick, chan); // Connect to server
29 Message send(String msg) // Send text as message
30 Message recv(void) // Blocking recv message
32 Message: // IRC Message:
36 Valid setHand(Set<Card> hand);
37 Valid setPile(Set<Card> pile);
38 Valid canPlay(Person who, Card card);
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);
48 void bid(Person who, int bid);
50 void show(Set<Card> hand);
51 void play(Person who, Card card);
54 void MsgListener(Message msg);
56 Valid BidListener(int bid);
57 Valid PassListener(Card card);
58 Valid LookListener(void);
59 Valid PlayListener(Card card);
60 Valid TurnListener(void);