|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--uk.org.redfelineninja.risk.server.RiskEngine
This class is the heart of the Risk system. This is a very large class that provides all the control and state broadcast for the Risk Arena. It is suitable for use in all servers and has been been extensively tested in use. There has been no boundary testing however so the odd bug may still remain.
Field Summary | |
static int |
ATTACK
|
static int |
FORTIFY
|
static int |
FORTIFY_PLACEMENT
|
static int |
GAME_OVER
|
static int |
ILLEGAL_ACTION
|
static int |
INIT_PLACEMENT
|
static int |
INIT_SELECTION
|
static int |
LIMITED_PLACEMENT
|
static int |
NO_ARMIES
|
static int |
NO_SUCH_COUNTRY
|
static int |
NOT_ADJACENT
|
static int |
NOT_ALLOWED
|
static int |
NOT_CURRENT_PLAYER
|
static int |
NOT_OWNER
|
static int |
OK
|
static int |
PLACEMENT
|
Constructor Summary | |
RiskEngine(Player[] p,
Adjacency a,
java.util.Hashtable ct,
RiskClientWriter clnt)
Create a new risk engine. |
Method Summary | |
int |
cheat(Player p)
Player p wants to cheat. |
int |
click(java.lang.String c,
Player p)
This method is called to inform the engine that a the player, p, has clicked on country. |
int |
finish(Player p)
Player p wants to finish their turn. |
void |
forceNextTurn()
Force the turn to move to the next player. |
int |
fortify(Player p)
Player p wants to fortify. |
Player |
getActivePlayer()
Returns the player whose turn it is. |
int |
getMode()
Returns the current mode. |
boolean |
liveGame()
|
void |
randomise()
Assign the players their countries randomly. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int INIT_SELECTION
public static final int INIT_PLACEMENT
public static final int PLACEMENT
public static final int ATTACK
public static final int LIMITED_PLACEMENT
public static final int FORTIFY_PLACEMENT
public static final int FORTIFY
public static final int OK
public static final int NO_ARMIES
public static final int NOT_CURRENT_PLAYER
public static final int NOT_ADJACENT
public static final int NOT_OWNER
public static final int ILLEGAL_ACTION
public static final int NO_SUCH_COUNTRY
public static final int NOT_ALLOWED
public static final int GAME_OVER
Constructor Detail |
public RiskEngine(Player[] p, Adjacency a, java.util.Hashtable ct, RiskClientWriter clnt)
p
- array of player to play this gamea
- adjacency matrix describing the boardct
- hashtable (String -> Continent)clnt
- the network interface for this engineMethod Detail |
public void randomise()
public Player getActivePlayer()
public boolean liveGame()
public int getMode()
public int click(java.lang.String c, Player p)
public void forceNextTurn()
public int fortify(Player p)
public int finish(Player p)
public int cheat(Player p)
p
-
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |