Atavism Version 2018.1AGIS API

atavism.agis.objects
Class ArenaQueue

java.lang.Object
  extended by atavism.agis.objects.ArenaQueue

public class ArenaQueue
extends java.lang.Object

The ArenaQueue class keeps track of players queued for a certain arena type. There should be a separate ArenaQueue object for each ArenaTemplate.

Author:
Andrew Harrison

Nested Class Summary
 class ArenaQueue.QueueMember
           
 
Field Summary
protected  int arenaCategory
           
protected  int arenaDifficulty
           
protected  java.lang.String arenaName
           
protected  int arenaType
           
protected  int groupInQueue
           
protected  atavism.agis.objects.ArenaQueue.QueueTeam[] groupteams
           
protected  int numTeams
           
protected  int playersInQueue
           
protected  boolean raceSpecific
           
protected  java.util.ArrayList<atavism.agis.objects.ArenaQueue.QueueTeam> teams
           
 
Constructor Summary
ArenaQueue(int numTeams, boolean raceSpecific, java.util.ArrayList<java.lang.String>[] teamRaces, int[] sizeReqs, int arenaType, java.lang.String arenaName, int category, int difficulty)
          ArenaQueue Constructor.
 
Method Summary
 boolean addGroup(java.util.LinkedList<OID> members, java.util.LinkedList<java.lang.String> membersName)
          Adds the player to the queue.
 boolean addPlayer(OID oid, java.lang.String name)
          Adds the player to the queue.
 int getArenaCategory()
           
 int getArenaDifficulty()
           
 java.lang.String getArenaName()
           
 int getArenaType()
           
 int getNumPlayersInQueue()
           
 java.util.ArrayList<ArenaQueue.QueueMember>[] getPlayersQueued()
           
 boolean isPlayerInQueue(OID oid)
          Searches through the arena queue to see if the player is already in it.
 boolean isQueueReady()
          Checks to see if there enough players queued to start a new arena.
 void removePlayer(OID oid)
          Removes the player from the queue.
 void setArenaCategory(int arenaCategory)
           
 void setArenaDifficulty(int arenaDifficulty)
           
 void setArenaName(java.lang.String arenaName)
           
 void setArenaType(int arenaType)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

numTeams

protected int numTeams

playersInQueue

protected int playersInQueue

groupInQueue

protected int groupInQueue

raceSpecific

protected boolean raceSpecific

teams

protected java.util.ArrayList<atavism.agis.objects.ArenaQueue.QueueTeam> teams

groupteams

protected atavism.agis.objects.ArenaQueue.QueueTeam[] groupteams

arenaType

protected int arenaType

arenaCategory

protected int arenaCategory

arenaName

protected java.lang.String arenaName

arenaDifficulty

protected int arenaDifficulty
Constructor Detail

ArenaQueue

public ArenaQueue(int numTeams,
                  boolean raceSpecific,
                  java.util.ArrayList<java.lang.String>[] teamRaces,
                  int[] sizeReqs,
                  int arenaType,
                  java.lang.String arenaName,
                  int category,
                  int difficulty)
ArenaQueue Constructor.

Parameters:
numTeams: - the number of teams in this queue
raceSpecific: - whether or not the teams require certain races
teamRaces: - an array of ArrayLists which list which races can queue for which team
sizeReqs: - an array indicating how many players need to be queued for each team for a new arena to begin
arenaName: - the name of the arena template this queue is for
Method Detail

addPlayer

public boolean addPlayer(OID oid,
                         java.lang.String name)
Adds the player to the queue. It checks if the queue requires different races and will get the players race if so. Otherwise adds them to the team that has the lowest filled percent.

Parameters:
oid: - the oid of the player being added to the queue

addGroup

public boolean addGroup(java.util.LinkedList<OID> members,
                        java.util.LinkedList<java.lang.String> membersName)
Adds the player to the queue. It checks if the queue requires different races and will get the players race if so. Otherwise adds them to the team that has the lowest filled percent.

Parameters:
oid: - the oid of the player being added to the queue

removePlayer

public void removePlayer(OID oid)
Removes the player from the queue. Searches through all the queues to find out which team queue the player was in.

Parameters:
oid: - the oid of the player being removed from the queue

isPlayerInQueue

public boolean isPlayerInQueue(OID oid)
Searches through the arena queue to see if the player is already in it.

Parameters:
oid: - the oid to check the queue for

isQueueReady

public boolean isQueueReady()
Checks to see if there enough players queued to start a new arena. The method gets the size of each team and sees if it is higher than the size required for that team.


getNumPlayersInQueue

public int getNumPlayersInQueue()

getPlayersQueued

public java.util.ArrayList<ArenaQueue.QueueMember>[] getPlayersQueued()

getArenaType

public int getArenaType()

setArenaType

public void setArenaType(int arenaType)

getArenaName

public java.lang.String getArenaName()

setArenaName

public void setArenaName(java.lang.String arenaName)

getArenaCategory

public int getArenaCategory()

setArenaCategory

public void setArenaCategory(int arenaCategory)

getArenaDifficulty

public int getArenaDifficulty()

setArenaDifficulty

public void setArenaDifficulty(int arenaDifficulty)


Copyright © 2018 Dragonsan Studios Sp. z o.o.