From: Andy Spencer Date: Fri, 12 Apr 2013 20:08:48 +0000 (+0000) Subject: Add IRC Service and update UI X-Git-Url: http://pileus.org/git/?p=~andy%2Fspades;a=commitdiff_plain;h=05aa01c6414c011546b2839573267ae3e1923d09 Add IRC Service and update UI --- diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 29376f9..540803d 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -6,11 +6,13 @@ + android:windowSoftInputMode="stateVisible|adjustResize"> + + diff --git a/doc/classes.txt b/doc/classes.txt new file mode 100644 index 0000000..341beca --- /dev/null +++ b/doc/classes.txt @@ -0,0 +1,72 @@ +/* Android Glue */ +Main: extends Activity // UI Code: + Handler handler; // Commands sent to Main by UI + Messenger messenger; // though handler/messenger + + bool onStart(); ... // Activity methods + + void onButtonClick(); ... // Widget callbacks + + void onRegister(task); // Set Task object on startup + void onConnect(void); // IRC connected + void onDisconnect(void); // IRC disconnected + void onMessage(msg); // IRC message received + +Task: extends Service // IRC connection as service: + bool onCreate(); ... // Service methods + + void run(); // IRC Client Thread entry + + Message send(String txt); // Send IRC message + +Util: // Misc functions + void debug(String str); // Print to debug log + +/* IRC Client Protocol */ +Client: // IRC Client: + void connect(srv, nick, chan); // Connect to server + + Message send(String msg) // Send text as message + Message recv(void) // Blocking recv message + +Message: // IRC Message: + +/* Spades game */ +Spades: + Valid setHand(Set hand); + Valid setPile(Set pile); + Valid canPlay(Person who, Card card); + +/* OpenGL Graphics */ +Cards: + void addBidListener(BidListener listener); + void addPassListener(PassListener listener); + void addLookListener(LookListener listener); + void addPlayListener(PlayListener listener); + void addTurnListener(TurnListener listener); + + void bid(Person who, int bid); + void pass(Card card); + void show(Set hand); + void play(Person who, Card card); + +/* Listeners */ +void MsgListener(Message msg); + +Valid BidListener(int bid); +Valid PassListener(Card card); +Valid LookListener(void); +Valid PlayListener(Card card); +Valid TurnListener(void); + +/* Types */ +Card: + +Team: + - Player a; + - Player b; + +Person: + - nickname + +// vim: ft=java diff --git a/res/layout/main.xml b/res/layout/main.xml index a84b00b..6b683d1 100644 --- a/res/layout/main.xml +++ b/res/layout/main.xml @@ -1,13 +1,72 @@ - - - - + android:layout_height="fill_parent"> + + + + + + + + +