cz.cuni.amis.pogamut.udk.communication.messages.gbinfomessages
Class GameInfo

Package class diagram package GameInfo
java.lang.Object
  extended by cz.cuni.amis.pogamut.base.communication.messages.InfoMessage
      extended by cz.cuni.amis.pogamut.udk.communication.messages.GBObjectUpdate
          extended by cz.cuni.amis.pogamut.udk.communication.messages.gbinfomessages.GameInfo
All Implemented Interfaces:
IWorldChangeEvent, IWorldObjectUpdatedEvent, IWorldObject, IGBWorldObjectEvent, cz.cuni.amis.utils.listener.Event

public class GameInfo
extends GBObjectUpdate
implements IGBWorldObjectEvent, IWorldObject

Asynchronous message. Sent as response to READY command. Information about the game. What type of game is it going to be, number of teams, maximum size of teams etc. Corresponding GameBots message is NFO.


Nested Class Summary
 
Nested classes/interfaces inherited from interface cz.cuni.amis.pogamut.base.communication.translator.event.IWorldObjectUpdatedEvent
IWorldObjectUpdatedEvent.DestroyWorldObject
 
Field Summary
protected  Location BlueBaseLocation
          Location of the base spawning the blue flag (team 1) (BotCTFGame).
protected  boolean BotsPaused
          If the game is paused just for bots - human controlled players can normally move.
protected  int FragLimit
          Number of kills needed to win game (BotDeathMatch only).
static UnrealId GameInfoId
           
protected  boolean GamePaused
          If the game is paused - nobody can move.
protected  String Gametype
          What you are playing (BotDeathMatch, BotTeamGame, BotCTFGame).
protected  double GoalTeamScore
          Number of points a team needs to win the game (BotTeamGame, BotCTFGame).
protected  String Level
          Name of map in game.
protected  int MaxTeams
          Max number of teams.
protected  int MaxTeamSize
          Max number of players per side (BotTeamGame, BotCTFGame).
static String PROTOTYPE
          Example how the message looks like - used during parser tests.
protected  Location RedBaseLocation
          Location of the base spawning the red flag (team 0) (BotCTFGame).
protected  double Time
           
protected  double TimeLimit
          Maximum time game will last (if tied at end may goe to "sudden death overtime" - depends on the game type).
protected  boolean WeaponStay
          If true respawned weapons will stay on the ground after picked up (but bot cannot pickup same weapon twice).
 
Constructor Summary
GameInfo()
          Used by Yylex to create empty message then to fill it's protected fields (Yylex is in the same package).
GameInfo(GameInfo original)
          Cloning constructor.
GameInfo(String Gametype, String Level, boolean WeaponStay, double TimeLimit, int FragLimit, double GoalTeamScore, int MaxTeams, int MaxTeamSize, Location RedBaseLocation, Location BlueBaseLocation, boolean GamePaused, boolean BotsPaused)
          Creates new instance of command GameInfo.
 
Method Summary
 boolean equals(Object obj)
           
 Location getBlueBaseLocation()
          Location of the base spawning the blue flag (team 1) (BotCTFGame).
 int getFragLimit()
          Number of kills needed to win game (BotDeathMatch only).
 String getGametype()
          What you are playing (BotDeathMatch, BotTeamGame, BotCTFGame).
 double getGoalTeamScore()
          Number of points a team needs to win the game (BotTeamGame, BotCTFGame).
 UnrealId getId()
           
 double getLastSeenTime()
           
 String getLevel()
          Name of map in game.
 ILocalWorldObject getLocal()
           
 int getMaxTeams()
          Max number of teams.
 int getMaxTeamSize()
          Max number of players per side (BotTeamGame, BotCTFGame).
 IWorldObject getObject()
          Returns original object (if method update() has already been called, for bot-programmer that is always true as the original object is updated and then the event is propagated).
 Location getRedBaseLocation()
          Location of the base spawning the red flag (team 0) (BotCTFGame).
 ISharedWorldObject getShared()
           
 long getSimTime()
           
 IStaticWorldObject getStatic()
           
protected  double getTime()
           
 double getTimeLimit()
          Maximum time game will last (if tied at end may goe to "sudden death overtime" - depends on the game type).
 int hashCode()
           
 boolean isBotsPaused()
          If the game is paused just for bots - human controlled players can normally move.
 boolean isGamePaused()
          If the game is paused - nobody can move.
 boolean isWeaponStay()
          If true respawned weapons will stay on the ground after picked up (but bot cannot pickup same weapon twice).
protected  void setTime(double time)
           
 String toHtmlString()
           
 String toString()
           
 IWorldObjectUpdateResult update(IWorldObject obj)
           
 
Methods inherited from class cz.cuni.amis.pogamut.base.communication.messages.InfoMessage
toJsonLiteral
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

PROTOTYPE

public static final String PROTOTYPE
Example how the message looks like - used during parser tests.

See Also:
Constant Field Values

Gametype

protected String Gametype
What you are playing (BotDeathMatch, BotTeamGame, BotCTFGame).


Level

protected String Level
Name of map in game.


WeaponStay

protected boolean WeaponStay
If true respawned weapons will stay on the ground after picked up (but bot cannot pickup same weapon twice).


TimeLimit

protected double TimeLimit
Maximum time game will last (if tied at end may goe to "sudden death overtime" - depends on the game type).


FragLimit

protected int FragLimit
Number of kills needed to win game (BotDeathMatch only).


GoalTeamScore

protected double GoalTeamScore
Number of points a team needs to win the game (BotTeamGame, BotCTFGame).


MaxTeams

protected int MaxTeams
Max number of teams. Valid team range will be 0 to (MaxTeams - 1) (BotTeamGame, BotCTFGame). Usually there will be two teams - 0 and 1.


MaxTeamSize

protected int MaxTeamSize
Max number of players per side (BotTeamGame, BotCTFGame).


RedBaseLocation

protected Location RedBaseLocation
Location of the base spawning the red flag (team 0) (BotCTFGame).


BlueBaseLocation

protected Location BlueBaseLocation
Location of the base spawning the blue flag (team 1) (BotCTFGame).


GamePaused

protected boolean GamePaused
If the game is paused - nobody can move.


BotsPaused

protected boolean BotsPaused
If the game is paused just for bots - human controlled players can normally move.


GameInfoId

public static final UnrealId GameInfoId

Time

protected double Time
Constructor Detail

GameInfo

public GameInfo(String Gametype,
                String Level,
                boolean WeaponStay,
                double TimeLimit,
                int FragLimit,
                double GoalTeamScore,
                int MaxTeams,
                int MaxTeamSize,
                Location RedBaseLocation,
                Location BlueBaseLocation,
                boolean GamePaused,
                boolean BotsPaused)
Creates new instance of command GameInfo. Asynchronous message. Sent as response to READY command. Information about the game. What type of game is it going to be, number of teams, maximum size of teams etc. Corresponding GameBots message for this command is .

Parameters:
Gametype - What you are playing (BotDeathMatch, BotTeamGame, BotCTFGame).
Level - Name of map in game.
WeaponStay - If true respawned weapons will stay on the ground after picked up (but bot cannot pickup same weapon twice).
TimeLimit - Maximum time game will last (if tied at end may goe to "sudden death overtime" - depends on the game type).
FragLimit - Number of kills needed to win game (BotDeathMatch only).
GoalTeamScore - Number of points a team needs to win the game (BotTeamGame, BotCTFGame).
MaxTeams - Max number of teams. Valid team range will be 0 to (MaxTeams - 1) (BotTeamGame, BotCTFGame). Usually there will be two teams - 0 and 1.
MaxTeamSize - Max number of players per side (BotTeamGame, BotCTFGame).
RedBaseLocation - Location of the base spawning the red flag (team 0) (BotCTFGame).
BlueBaseLocation - Location of the base spawning the blue flag (team 1) (BotCTFGame).
GamePaused - If the game is paused - nobody can move.
BotsPaused - If the game is paused just for bots - human controlled players can normally move.

GameInfo

public GameInfo(GameInfo original)
Cloning constructor.


GameInfo

public GameInfo()
Used by Yylex to create empty message then to fill it's protected fields (Yylex is in the same package).

Method Detail

getGametype

public String getGametype()
What you are playing (BotDeathMatch, BotTeamGame, BotCTFGame).


getLevel

public String getLevel()
Name of map in game.


isWeaponStay

public boolean isWeaponStay()
If true respawned weapons will stay on the ground after picked up (but bot cannot pickup same weapon twice).


getTimeLimit

public double getTimeLimit()
Maximum time game will last (if tied at end may goe to "sudden death overtime" - depends on the game type).


getFragLimit

public int getFragLimit()
Number of kills needed to win game (BotDeathMatch only).


getGoalTeamScore

public double getGoalTeamScore()
Number of points a team needs to win the game (BotTeamGame, BotCTFGame).


getMaxTeams

public int getMaxTeams()
Max number of teams. Valid team range will be 0 to (MaxTeams - 1) (BotTeamGame, BotCTFGame). Usually there will be two teams - 0 and 1.


getMaxTeamSize

public int getMaxTeamSize()
Max number of players per side (BotTeamGame, BotCTFGame).


getRedBaseLocation

public Location getRedBaseLocation()
Location of the base spawning the red flag (team 0) (BotCTFGame).


getBlueBaseLocation

public Location getBlueBaseLocation()
Location of the base spawning the blue flag (team 1) (BotCTFGame).


isGamePaused

public boolean isGamePaused()
If the game is paused - nobody can move.


isBotsPaused

public boolean isBotsPaused()
If the game is paused just for bots - human controlled players can normally move.


getId

public UnrealId getId()
Specified by:
getId in interface IWorldObjectUpdatedEvent
Specified by:
getId in interface IWorldObject

getTime

protected double getTime()

setTime

protected void setTime(double time)

getLastSeenTime

public double getLastSeenTime()

getLocal

public ILocalWorldObject getLocal()

getShared

public ISharedWorldObject getShared()

getStatic

public IStaticWorldObject getStatic()

getSimTime

public long getSimTime()
Specified by:
getSimTime in interface IWorldChangeEvent
Specified by:
getSimTime in interface IWorldObject

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

update

public IWorldObjectUpdateResult update(IWorldObject obj)
Specified by:
update in interface IWorldObjectUpdatedEvent

getObject

public IWorldObject getObject()
Returns original object (if method update() has already been called, for bot-programmer that is always true as the original object is updated and then the event is propagated).


toString

public String toString()
Overrides:
toString in class InfoMessage

toHtmlString

public String toHtmlString()


Copyright © 2014 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.