|
|||||||||
Atavism Version 2018.1 | AGIS API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectatavism.agis.objects.SurvivalArena
public class SurvivalArena
The Arena class handles an arena instance. It has numerous scheduled executors and a state variable to control the flow of the arena from setup to the end. This class is complete, it relies on no other class to perform it's duties.
Nested Class Summary | |
---|---|
class |
SurvivalArena.ArenaCleanup
Teleports all players out and then sends out a message to remove this arena instance from the Map stored in the ArenaPlugin. |
class |
SurvivalArena.ArenaStart
Starts the arena. |
class |
SurvivalArena.NewRound
|
Field Summary | |
---|---|
protected int |
activePlayers
|
protected int |
arenaID
|
protected java.lang.String |
arenaName
|
protected int |
arenaType
|
protected java.util.ArrayList<OID> |
creatures
|
protected java.util.ArrayList<java.lang.Integer>[] |
creatureSpawns
|
protected int |
currentRound
|
protected java.util.ArrayList<java.lang.Integer> |
damageDealt
|
protected java.util.ArrayList<java.lang.Integer> |
damageTaken
|
protected java.util.ArrayList<java.lang.Integer> |
deaths
|
protected OID |
instanceOid
|
protected int |
instanceTemplateID
|
protected java.util.ArrayList<java.lang.Integer> |
kills
|
protected int |
length
|
protected java.util.ArrayList<java.lang.String> |
names
|
protected int |
numRounds
|
protected java.util.ArrayList<OID> |
players
|
protected java.util.ArrayList<ArenaStats> |
ratings
|
protected java.util.ArrayList<java.lang.Integer> |
scores
|
protected int |
startTime
|
protected java.util.ArrayList<java.lang.Long> |
subs
|
protected boolean |
teamActive
|
protected java.lang.String |
teamName
|
protected int |
teamScore
|
protected long |
timeArenaStarted
|
protected int |
victoryCondition
|
protected java.util.HashMap<java.lang.Integer,java.lang.Integer> |
victoryPayment
|
Fields inherited from interface atavism.msgsys.MessageCallback |
---|
NO_FLAGS, RESPONSE_EXPECTED |
Constructor Summary | |
---|---|
SurvivalArena(int numRounds)
The default constructor. |
|
SurvivalArena(int id,
int numRounds,
java.util.ArrayList<java.lang.Integer>[] creatureSpawns,
java.util.ArrayList<OID> oids,
java.util.ArrayList<java.lang.String> names,
int type,
java.lang.String arenaName,
int dur,
int condition,
int instanceTemplateID,
java.util.HashMap<java.lang.Integer,java.lang.Integer> victoryPayment)
Constructor that takes in two lists that contain the oids of the players on each team. |
Method Summary | |
---|---|
void |
addArenaCreature(OID creatureOid)
Adds a newly spawned creature oid to the list of creatures alive in the arena and sets up a subscription to catch their damage messages. |
int |
getArenaID()
|
OID |
getArenaInstanceOid()
|
int |
getArenaType()
|
java.util.ArrayList<java.lang.Integer> |
getDeaths()
|
int |
getInstanceTemplateID()
|
java.util.ArrayList<java.lang.Integer> |
getKills()
|
int |
getLength()
|
java.util.ArrayList<java.lang.String> |
getNames()
|
java.util.ArrayList<OID> |
getPlayers()
|
java.util.ArrayList<java.lang.Integer> |
getScores()
|
int |
getState()
|
java.lang.String |
getTeamName()
|
void |
handleDeath(OID attackerOid,
OID victimOid)
This will be called whenever a player or creature in the arena dies. |
void |
handleMessage(Message msg,
int flags)
process network messages |
void |
removePlayer(OID oid)
Removes a player from the arena. |
void |
setArenaID(int arenaID)
|
void |
setArenaInstanceOid(OID instanceOid)
|
void |
setArenaType(int arenaType)
|
void |
setDeaths(java.util.ArrayList<java.lang.Integer> deaths)
|
void |
setInstanceTemplateID(int instanceTemplateID)
|
void |
setKills(java.util.ArrayList<java.lang.Integer> kills)
|
void |
setLength(int length)
|
void |
setNames(java.util.ArrayList<java.lang.String> names)
|
void |
setPlayers(java.util.ArrayList<OID> players)
|
void |
setScores(java.util.ArrayList<java.lang.Integer> scores)
|
void |
setState(int state)
|
void |
setTeamName(java.lang.String teamName)
|
void |
setup()
This is run once the Arena object is created. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int arenaID
protected int arenaType
protected java.lang.String arenaName
protected OID instanceOid
protected int length
protected int startTime
protected int instanceTemplateID
protected java.util.HashMap<java.lang.Integer,java.lang.Integer> victoryPayment
protected int numRounds
protected int currentRound
protected long timeArenaStarted
protected boolean teamActive
protected int teamScore
protected java.lang.String teamName
protected int activePlayers
protected java.util.ArrayList<OID> creatures
protected java.util.ArrayList<OID> players
protected java.util.ArrayList<java.lang.String> names
protected java.util.ArrayList<java.lang.Integer> scores
protected java.util.ArrayList<java.lang.Integer> kills
protected java.util.ArrayList<java.lang.Integer> deaths
protected java.util.ArrayList<java.lang.Integer> damageTaken
protected java.util.ArrayList<java.lang.Integer> damageDealt
protected java.util.ArrayList<java.lang.Integer>[] creatureSpawns
protected transient java.util.ArrayList<java.lang.Long> subs
protected java.util.ArrayList<ArenaStats> ratings
protected int victoryCondition
Constructor Detail |
---|
public SurvivalArena(int numRounds)
numTeams:
- the number of teams in the arenapublic SurvivalArena(int id, int numRounds, java.util.ArrayList<java.lang.Integer>[] creatureSpawns, java.util.ArrayList<OID> oids, java.util.ArrayList<java.lang.String> names, int type, java.lang.String arenaName, int dur, int condition, int instanceTemplateID, java.util.HashMap<java.lang.Integer,java.lang.Integer> victoryPayment)
one:
- the list of oids for players on team onetwo:
- the list of oids for players on team twotype:
- the arena typedur:
- the duration of the arenagoals:
- the goal score for the teamsloc:
- the centre point of the arenaid:
- the identification number of the arenaminPlayers:
- the minimum number of players in each teamMethod Detail |
---|
public void setup()
public void handleMessage(Message msg, int flags)
handleMessage
in interface MessageCallback
msg
- Message sent from other agent.flags
- Bitwise OR of MessageCallback.NO_FLAGS
, MessageCallback.RESPONSE_EXPECTED
.public void addArenaCreature(OID creatureOid)
creatureOid
- public void removePlayer(OID oid)
oid:
- The player being removed from the arenapublic void handleDeath(OID attackerOid, OID victimOid)
attackerOid:
- the oid of the attackervictimOid:
- the oid of the victimpublic int getArenaID()
public void setArenaID(int arenaID)
public OID getArenaInstanceOid()
public void setArenaInstanceOid(OID instanceOid)
public int getArenaType()
public void setArenaType(int arenaType)
public int getLength()
public void setLength(int length)
public int getInstanceTemplateID()
public void setInstanceTemplateID(int instanceTemplateID)
public int getState()
public void setState(int state)
public java.lang.String getTeamName()
public void setTeamName(java.lang.String teamName)
public java.util.ArrayList<OID> getPlayers()
public void setPlayers(java.util.ArrayList<OID> players)
public java.util.ArrayList<java.lang.String> getNames()
public void setNames(java.util.ArrayList<java.lang.String> names)
public java.util.ArrayList<java.lang.Integer> getScores()
public void setScores(java.util.ArrayList<java.lang.Integer> scores)
public java.util.ArrayList<java.lang.Integer> getKills()
public void setKills(java.util.ArrayList<java.lang.Integer> kills)
public java.util.ArrayList<java.lang.Integer> getDeaths()
public void setDeaths(java.util.ArrayList<java.lang.Integer> deaths)
|
Copyright © 2018 Dragonsan Studios Sp. z o.o. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |