public class Duel
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Class and Description |
---|---|
class |
Duel.DuelStart
Starts the arena.
|
class |
Duel.PositionCheck |
Modifier and Type | Field and Description |
---|---|
protected java.util.ArrayList<java.lang.Boolean>[] |
activeFighters |
protected Point |
centerLoc |
static java.lang.String |
DUEL_FLAG_MODEL |
protected int |
duelID |
protected int |
duelType |
protected OID |
flagOid |
protected java.util.ArrayList<java.lang.Integer>[] |
oobTimer |
protected java.util.ArrayList<java.lang.Integer> |
teamHealths |
protected java.lang.String[] |
teamLeader |
protected java.util.ArrayList<OID>[] |
teams |
protected java.lang.Integer |
testTimer
Iterates through every player in the duel and makes sure they are still within
30m of the center point of the duel.
|
protected int |
timeUntilStart |
Constructor and Description |
---|
Duel()
The default constructor.
|
Duel(java.lang.String[] teamLeaders,
java.util.ArrayList<OID>[] oids,
int type,
int id,
Point centerLoc,
OID flagOid)
Constructor that takes in two lists that contain the oids of the players
on each team.
|
Modifier and Type | Method and Description |
---|---|
void |
addKillScore(OID attackerOid,
OID victimOid)
This will be called whenever one player kills another.
|
void |
checkActivePlayers()
This function runs through all the players in both teams to see if any teams have
no active players left.
|
void |
disconnectedPlayer(OID oid,
java.lang.String playerName)
Removes a player from the arena.
|
java.util.ArrayList<java.lang.Boolean>[] |
getActiveFighters() |
Point |
getCenter() |
int |
getDuelID() |
int |
getDuelType() |
OID |
getFlagOid() |
java.util.ArrayList<java.lang.Integer>[] |
getOobTimers() |
int |
getState() |
java.util.ArrayList<OID> |
getTeam(int team) |
java.lang.String[] |
getTeamLeaders() |
java.util.ArrayList<OID>[] |
getTeams() |
void |
removePlayer(OID oid)
Removes a player from the arena.
|
void |
setActiveFighters(java.util.ArrayList<java.lang.Boolean>[] activeFighters) |
void |
setCenter(Point centerLoc) |
void |
setDuelID(int duelID) |
void |
setDuelType(int duelType) |
void |
setFlagOid(OID flagOid) |
void |
setOobTimers(java.util.ArrayList<java.lang.Integer>[] oobTimer) |
void |
setState(int state) |
void |
setTeam(int team,
java.util.ArrayList<OID> teams) |
void |
setTeamLeaders(java.lang.String[] teamLeader) |
void |
setTeams(java.util.ArrayList<OID>[] teams) |
void |
setup()
This is run once the Duel object is created.
|
protected int duelID
protected int duelType
protected java.util.ArrayList<OID>[] teams
protected java.util.ArrayList<java.lang.Boolean>[] activeFighters
protected java.util.ArrayList<java.lang.Integer>[] oobTimer
protected Point centerLoc
protected java.lang.String[] teamLeader
protected OID flagOid
protected int timeUntilStart
protected java.lang.Integer testTimer
protected java.util.ArrayList<java.lang.Integer> teamHealths
public static final java.lang.String DUEL_FLAG_MODEL
public Duel()
public Duel(java.lang.String[] teamLeaders, java.util.ArrayList<OID>[] oids, int type, int id, Point centerLoc, OID flagOid)
oids:
- the oids of the players involved in this dueltype:
- the duel typeloc:
- the centre point of the duelid:
- the identification number of the duelpublic void setup()
public void checkActivePlayers()
public void removePlayer(OID oid)
oid:
- The player being removed from the arenapublic void disconnectedPlayer(OID oid, java.lang.String playerName)
oid:
- The player being removed from the arenapublic void addKillScore(OID attackerOid, OID victimOid)
attackerOid:
- the oid of the attackervictimOid:
- the oid of the victimpublic int getDuelID()
public void setDuelID(int duelID)
public int getDuelType()
public void setDuelType(int duelType)
public int getState()
public void setState(int state)
public java.util.ArrayList<OID>[] getTeams()
public void setTeams(java.util.ArrayList<OID>[] teams)
public java.util.ArrayList<OID> getTeam(int team)
public void setTeam(int team, java.util.ArrayList<OID> teams)
public java.util.ArrayList<java.lang.Boolean>[] getActiveFighters()
public void setActiveFighters(java.util.ArrayList<java.lang.Boolean>[] activeFighters)
public java.util.ArrayList<java.lang.Integer>[] getOobTimers()
public void setOobTimers(java.util.ArrayList<java.lang.Integer>[] oobTimer)
public java.lang.String[] getTeamLeaders()
public void setTeamLeaders(java.lang.String[] teamLeader)
public Point getCenter()
public void setCenter(Point centerLoc)
public OID getFlagOid()
public void setFlagOid(OID flagOid)