JCG Co.

Game Design

/************************************************************************************/
/****************************      Client     ***************************************/
/************************************************************************************/

        // Responsible for any initializations,
        // communications with SocketControl
        CounterAttack
           init();
           start();
           stop();
           run();
           newGame();
           requestMove(int index, int category, String value, int rank);
           stealCard();         
           counterAttack();      
           block();
           mouseHandlers();

        // Handle display of GUI to applet
        CounterAttackDisplay
           update();
           paint();
           drawMenu();
           drawGameMenu();
           drawMP3Menu();               
           updateServerMessages();      

        // extends SocketControl
        CounterAttackClientConnection
           getTheirMove();

           getStatus();
           sendMove(String s, int type);
           listen();
        
        // Controls communication with client
        SocketControl
           void send(String s, int type);
           String receive();
           void closeConnections();
           boolean isConnected();
           void finalize();                     

        Card                            
           Card(int index);
           public String getValue(int category);        // Returns Value for given Category
           public int getRank(int category);            // Returns Rank for given Category

/************************************************************************************/
/****************************      Server     ***************************************/
/************************************************************************************/

        // Initializes CounterAttackDaemon
        CounterAttackServer 
           
        // Initializes CounterAttackPlayer
        CounterAttackPlayer
           run();
           closeConnections();

        // Determines how to allocate games
        CounterAttackDaemon
           extends Thread
           run();
           waitForGame(CounterAttackPlayer p)
           finalize();


        
        // Used to house state variables, score...
        CounterAttackGame                         
           playGame(CounterAttackPlayer p);
           getStatus(CounterAttackPlayer p);
           receiveStatus(CounterAttackPlayer p, int message)
           verifyMove(); 
           
        // Controls communication with client
        SocketControl
           void send(String s);
           String receive();
           void closeConnections();
           boolean isConnected();
           void finalize();