public class PP
extends java.lang.Thread
Modifier and Type | Class and Description |
---|---|
static class |
PP.Coalition
Define Coalition type.
|
Constructor and Description |
---|
PP()
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Shutdown and cleanup Prog&Play API.
|
java.awt.geom.Point2D.Float |
getMapSize() |
int |
getNumSpecialAreas() |
int |
getNumUnits(PP.Coalition c)
Returns the number of units from the "c" coalition.
|
int |
getResource(int id) |
java.awt.geom.Point2D.Float |
getSpecialAreasPosition(int z) |
java.awt.geom.Point2D.Float |
getStartPosition() |
Unit |
getUnitAt(PP.Coalition c,
int i)
Returns the nth visible unit of the "c" coalition.
|
boolean |
isGameOver() |
void |
open()
Opens Prog&Play API.
|
void |
run()
Close Prog&Play API when the jvm stop.
|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
close()
public void open() throws PPException
PPException
- on errors linked with Prog&Play.public void close() throws PPException
PPException
- on errors linked with Prog&Play.public boolean isGameOver() throws PPException
true
if the game is ended and false
if
not.PPException
- on errors linked with Prog&Play.public java.awt.geom.Point2D.Float getMapSize() throws java.lang.InstantiationException, PPException
PPException
- on errors linked with Prog&Play.java.lang.InstantiationException
- on allocation problem.public java.awt.geom.Point2D.Float getStartPosition() throws java.lang.InstantiationException, PPException
PPException
- on errors linked with Prog&Play.java.lang.InstantiationException
- on allocation problem.public int getNumSpecialAreas() throws PPException
PPException
- on errors linked with Prog&Play.public java.awt.geom.Point2D.Float getSpecialAreasPosition(int z) throws java.lang.InstantiationException, PPException
num
- id of a special area, it must be included meanwhile [0;n[ where
n is the number of special areas returned by
getNumSpecialAreas
.PPException
- on errors linked with Prog&Play.java.lang.InstantiationException
- on allocation problem.getNumSpecialAreas()
public int getResource(int id) throws PPException
id
- id of resource that you want know level.PPException
- on errors linked with Prog&Play.public int getNumUnits(PP.Coalition c) throws PPException
c
- coalition to consult.PPException
- on errors linked with Prog&Play.public Unit getUnitAt(PP.Coalition c, int i) throws PPException
c
- coalition to consult.i
- id of a unit in the coalition "c", must be included meanwhile
[0;n[ where n is the number of units of this coalition (returned
by getNumUnits
).PPException
- on errors linked with Prog&Play.getNumUnits(pp.PP.Coalition)