spellcast.game
Class Game_Server

java.lang.Object
  extended by spellcast.game.Game_Server
All Implemented Interfaces:
java.beans.PropertyChangeListener, java.lang.Runnable, java.util.EventListener

public class Game_Server
extends java.lang.Object
implements java.beans.PropertyChangeListener, java.lang.Runnable

The Game Server class is the control logic for the Game. It inherits from Game which contains the Data Access methods.

Author:
Barrie Treloar

Constructor Summary
Game_Server(IPC ipc, java.lang.String gameName)
           
 
Method Summary
 Game getGame()
           
 void processOkEvent(IPCRequest request)
          Process OkEvent.
 void propertyChange(java.beans.PropertyChangeEvent pce)
          Unless otherwise specified, all property change events are forwarded to all clients
 void run()
           
 void sendMessage(java.lang.String message)
          Send a message to everyone.
 void sendMessage2(Id id1, java.lang.String messageForID1, java.lang.String messageForEveryoneElse)
          Send a message to one Id and another message to everyone else.
 void sendMessage3(Id id1, java.lang.String messageForID1, Id id2, java.lang.String messageForID2, java.lang.String messageForEveryoneElse)
          Send a message to one Id, a message to another Id, and a message to everyone else.
 void start()
          Start the Game Server.
 void stop()
          Stop the Game Server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Game_Server

public Game_Server(IPC ipc,
                   java.lang.String gameName)
Method Detail

getGame

public Game getGame()

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent pce)
Unless otherwise specified, all property change events are forwarded to all clients

Specified by:
propertyChange in interface java.beans.PropertyChangeListener

run

public void run()
Specified by:
run in interface java.lang.Runnable

processOkEvent

public void processOkEvent(IPCRequest request)
Process OkEvent.


start

public void start()
Start the Game Server. This creates a new thread and starts the thread running.


stop

public void stop()
Stop the Game Server. This sets isRunning to false which allows the run method to terminate. stop will cause the calling thread to wait until the Game Server Thread has terminated.


sendMessage

public void sendMessage(java.lang.String message)
Send a message to everyone.


sendMessage2

public void sendMessage2(Id id1,
                         java.lang.String messageForID1,
                         java.lang.String messageForEveryoneElse)
Send a message to one Id and another message to everyone else.


sendMessage3

public void sendMessage3(Id id1,
                         java.lang.String messageForID1,
                         Id id2,
                         java.lang.String messageForID2,
                         java.lang.String messageForEveryoneElse)
Send a message to one Id, a message to another Id, and a message to everyone else.



Copyright © 2001-2005 Spellcast. All Rights Reserved.