|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cz.cuni.amis.pogamut.base.agent.module.AgentModule<AGENT> cz.cuni.amis.pogamut.base.agent.module.SensorModule<UT2004Bot> cz.cuni.amis.pogamut.ut2004.agent.module.sensor.Game
public class Game
Memory module specialized on general info about the game.
It is designed to be initialized inside IUT2004BotController.prepareBot(UT2004Bot)
method call
and may be used since IUT2004BotController.botInitialized(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.ConfigChange, cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.InitedMessage)
is called.
Nested Class Summary | |
---|---|
static class |
Game.GameType
Enums for game types that shields you from Unreal's string ids of game types. |
Field Summary |
---|
Fields inherited from class cz.cuni.amis.pogamut.base.agent.module.SensorModule |
---|
worldView |
Fields inherited from class cz.cuni.amis.pogamut.base.agent.module.AgentModule |
---|
agent, controller, eventBus, log |
Constructor Summary | |
---|---|
Game(UT2004Bot bot)
Constructor. |
|
Game(UT2004Bot bot,
java.util.logging.Logger log)
Constructor. |
Method Summary | |
---|---|
protected void |
cleanUp()
Hook where to perform clean up of data structures of the module. |
java.util.Map<java.lang.Integer,FlagInfo> |
getAllCTFFlags()
Returns a map indexed by team numbers, holding all flags in the game. |
java.util.Collection<FlagInfo> |
getAllCTFFlagsCollection()
Returns a collection of all the flags in the game. |
FlagInfo |
getCTFFlag(int team)
Retrieves FlagInfo object representing the Flag for input team in BotCTFGame. |
java.util.Collection<FlagInfo> |
getCTFFlags()
Retrieves all FlagInfo objects in the game (by default two) in BotCTFGame. |
java.util.Collection<NavPoint> |
getDominationPoints()
Retrieves all domination points in the game (by default two) in BotDoubleDomination. |
java.lang.Integer |
getFragLimit()
BotDeathMatch only: |
java.lang.Integer |
getFullHealth()
Retreives maximum level of non-boosted health. |
GameInfo |
getGameInfo()
Returns original GameInfo message. |
Game.GameType |
getGameType()
Retreives the type of the game. |
java.lang.String |
getMapName()
Retreives the name of current map. |
java.lang.Integer |
getMaxAdrenaline()
Retreives maximum level of adrenaline that can be gained. |
java.lang.Integer |
getMaxArmor()
Retreives maximum level of combined armor. |
java.lang.Integer |
getMaxHealth()
Retreives maximum level of boosted health. |
int |
getMaxHighArmor()
Retreives maximum level of high armor. |
int |
getMaxLowArmor()
Retreives maximum level of low armor. |
java.lang.Integer |
getMaxMultiJump()
Retreives the maximum number of multi-jumping combos. |
java.lang.Integer |
getMaxTeams()
BotTeamGame, BotCTFGame, BotDoubleDomination only: |
java.lang.Integer |
getMaxTeamSize()
BotTeamGame, BotCTFGame, BotDoubleDomination only: |
java.util.List<Mutator> |
getMutators()
Returns list of mutators that are active in the current game. |
int |
getPlayerDeaths(UnrealId id)
Retreives number of deaths the agent took. |
int |
getPlayerScore(UnrealId id)
Retreives agent score. |
java.util.Map<UnrealId,PlayerScore> |
getPlayerScores()
Returns unmodifiable map with player scores. |
java.lang.String |
getPrefixed(java.lang.String objectId)
It returns 'objectId' prefixed with " getMapName() .". |
UnrealId |
getPrefixedId(java.lang.String objectId)
It returns 'objectId' prefixed with " getMapName() .". |
java.lang.Double |
getRemainingTime()
Retreives time remaining for the game. |
java.lang.Integer |
getStartAdrenaline()
Retreives starting level of adrenaline. |
java.lang.Integer |
getStartHealth()
Retreives starting level of health. |
java.lang.Integer |
getTargetAdrenaline()
Retreives target level of adrenaline that need to be gained to start special bonus actions. |
int |
getTeamScore(int team)
Retrieves teams team score. |
java.lang.Integer |
getTeamScoreLimit()
BotTeamGame, BotCTFGame, BotBombingRun, BotDoubleDomination only: |
java.util.Map<java.lang.Integer,TeamScore> |
getTeamScores()
Returns unmodifiable map with team scores. |
double |
getTime()
Retreives current game time, since the game started. |
java.lang.Double |
getTimeLimit()
Retreives time limit for the game. |
java.lang.Boolean |
getWeaponsStay()
Tells, whether the weapons stay on pick-up points, even when they are picked-up by players. |
java.lang.Boolean |
isBotsPaused()
Tells, whether the bots are paused or running. |
boolean |
isMapName(java.lang.String name)
Tells, whether the UT2004 is currently running map with name 'name'. |
java.lang.Boolean |
isPaused()
Tells, whether the game is paused or running. |
boolean |
isPlayerDeathsKnown(UnrealId player)
Tells whether the number of deaths for 'player' is known. |
boolean |
isPlayerScoreKnown(UnrealId player)
Tells whether the player score for 'player' is known. |
boolean |
isTeamScoreKnown(int team)
Tells whether the team score for 'team' is known. |
Methods inherited from class cz.cuni.amis.pogamut.base.agent.module.AgentModule |
---|
getComponentId, getLog, getState, initComponentId, isRunning, kill, pause, reset, resume, start, stop, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Game(UT2004Bot bot)
bot
- owner of the module that is using itpublic Game(UT2004Bot bot, java.util.logging.Logger log)
bot
- owner of the module that is using itlog
- Logger to be used for logging runtime/debug info. If null, the module creates its own logger.Method Detail |
---|
public GameInfo getGameInfo()
GameInfo
message.
public Game.GameType getGameType()
public java.lang.String getMapName()
public boolean isMapName(java.lang.String name)
name
-
public java.lang.String getPrefixed(java.lang.String objectId)
getMapName()
.".
Note that you may pass prefixed objectId into this method, it will detect it that and auto-correct upper/lower case of this existing prefix if needed. Also you may use it as a validation feature because this method will raise an exception if the prefix does not match the current map name.
objectId
- will be auto-prefixed (if enabled, which is default)
public UnrealId getPrefixedId(java.lang.String objectId)
getMapName()
.".
Note that you may pass prefixed objectId into this method, it will detect it that and auto-correct upper/lower case of this existing prefix if needed. Also you may use it as a validation feature because this method will raise an exception if the prefix does not match the current map name.
objectId
- will be auto-prefixed (if enabled, which is default)
UnrealId
public double getTime()
public java.lang.Double getTimeLimit()
Note: Then the time limit is reached and the game is tie, special game modes might be turned on, e.g. sudden death overtime. Depends on the game type and game settings.
getRemainingTime()
public java.lang.Double getRemainingTime()
Note: Then the time limit is reached and the game is tie, special game modes might be turned on, e.g. sudden death overtime. Depends on the game type and game settings.
getTime()
,
getTimeLimit()
public java.lang.Integer getFragLimit()
Number of points (e.g. kills) needed to win the game.
getTeamScoreLimit()
public java.lang.Integer getTeamScoreLimit()
Number of points a team needs to win the game.
getFragLimit()
public FlagInfo getCTFFlag(int team)
team
- to get the flag for.
public java.util.Collection<FlagInfo> getCTFFlags()
public java.util.Collection<NavPoint> getDominationPoints()
public java.util.Map<java.lang.Integer,TeamScore> getTeamScores()
Map is unsynchronized! If you want to iterate it over, use synchronized statement over the map.
public int getTeamScore(int team)
Team score is usually rising by achieving team goals, e.g. killing opponents, capturing flags, controlling domination points, etc. Note: Team score might decrease, when opposing teams score points themselves, based on map, game type and game settings.
Note that if Integer.MIN_VALUE
is returned, it means that the score is unknown.
team
- to get the team score for.
public boolean isTeamScoreKnown(int team)
team
-
public java.util.Map<UnrealId,PlayerScore> getPlayerScores()
PlayerScore
message you can get also PlayerScore.getDeaths()
.)
Map is unsynchronized! If you want to iterate it over, use synchronized statement over the map.
public int getPlayerScore(UnrealId id)
Agent score is usually rising by achieving some goals, e.g. killing opponents, capturing flags, controlling domination points, etc. Note: Agent score might decrease upon suicides, based on map, game type and game settings.
Note that if Integer.MIN_VALUE
is returned, than the score is unknown.
id
- id of the player
public boolean isPlayerScoreKnown(UnrealId player)
player
-
public int getPlayerDeaths(UnrealId id)
A death is counted, whenever the agent dies.
Note that if Integer.MIN_VALUE
is returned, than the number of deaths is unknown.
public boolean isPlayerDeathsKnown(UnrealId player)
player
-
public java.lang.Integer getMaxTeams()
Retrieves number of teams in the game.
Team numbers start from 0. Usually, there are just two teams: 0 and 1.
public java.lang.Integer getMaxTeamSize()
Retreives maximum number of players per team.
public java.lang.Integer getStartHealth()
getMaxHealth()
,
getFullHealth()
public java.lang.Integer getFullHealth()
getStartHealth()
,
getMaxHealth()
public java.lang.Integer getMaxHealth()
getStartHealth()
,
getFullHealth()
public java.lang.Integer getMaxArmor()
getMaxLowArmor()
,
getMaxHighArmor()
public int getMaxLowArmor()
Low armor is powered-up by small shield.
getMaxArmor()
,
getMaxHighArmor()
public int getMaxHighArmor()
High armor is powered-up by super-shield.
getMaxArmor()
,
getMaxLowArmor()
public java.lang.Integer getStartAdrenaline()
public java.lang.Integer getTargetAdrenaline()
Once the agent's adrenaline reaches this designated level, it can be used to start special bonus booster-actions like invisibility, speed, booster, etc. The adrenaline is then spent on the invoked action.
public java.lang.Integer getMaxAdrenaline()
public java.lang.Boolean getWeaponsStay()
If so, each weapon type can be picked up from pick-up points only once. If the player already has the weapon the pick-up point offers, he can not pick it up. Also, each weapon pick-up point always contains its associated weapon.
If not, weapons can be picked up from pick-up points repeatedly. If the player already has the weapon the pick-up point offers, the pick-up will simply replenish ammo for that weapon. Also, upon each pick-up by a player, the offered weapon disappears (it is "taken" by that player). Weapons respawn on empty pick-up points after a while.
public java.lang.Integer getMaxMultiJump()
Note: Multi-jump combos are currently limited to double-jumps for bots.
public java.util.List<Mutator> getMutators()
public java.lang.Boolean isPaused()
areBotsPaused()
public java.lang.Boolean isBotsPaused()
isPaused()
public java.util.Map<java.lang.Integer,FlagInfo> getAllCTFFlags()
public java.util.Collection<FlagInfo> getAllCTFFlagsCollection()
protected void cleanUp()
AgentModule
Called from AgentModule.stop()
, AgentModule.kill()
, AgentModule.reset()
.
cleanUp
in class AgentModule<UT2004Bot>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |