Title: GameControl
Course: CPS 261: Advanced Java Concepts ~ DL & MM MASTER

Package | Class | Use | Tree | Deprecated | Index | Help |
PREV CLASS   NEXT CLASS | FRAMES    NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

gameNet_cloneable
Class GameControl


java.lang.Object
  gameNet_cloneable.GameControl


public class GameControl
extends java.lang.Object




The GameControl class provides the overall framework for gameNet. This class has a constructor for starting up a server to host a game. Another constructor is available for connecting to an existing server.

This class mostly does its work behind the scenes for many Networked Games. However, if your Networked game must send updates that are not the direct results of a user's input (i.e. a Pong game with a bouncing ball), then you will see the GameControl class.

If your game needs to send out updates that are not directly tied to user inputs, you will do the following:
- You will override the startGame method in GameNet_CoreGame class. When startGame is called, you will receive the address of your GameControl class. You must save this address.
- When you want to send out output, just call the putMsgs method in your saved GameControl class

Method Summary
void | putMsgs(java.lang.Object objectOutput) If your GameControl requires a thread to return updates that are not related to user inputs, then this method must be called to send the updates back to the GUI.

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Method Detail

putMsgs


public void putMsgs(java.lang.Object objectOutput)

If your GameControl requires a thread to return updates that are not related to user inputs, then this method must be called to send the updates back to the GUI. For example, a Pong game would need this to send ball updates that are not directly associated with a user input.

Parameters:
objectOutput - is an output that is returned to the GUI from the GameControl

Package | Class | Use | Tree | Deprecated | Index | Help |
PREV CLASS   NEXT CLASS | FRAMES    NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD