|
||||||||||
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<UDKBot> cz.cuni.amis.pogamut.udk.agent.module.sensor.Players
public class Players
Memory module specialized on whereabouts of other players.
All Player objects returned by this memory module are always self-updating throughout the time, until the associated player leaves the game. This means that once a valid Player object is obtained, it is not necessary to call any methods of this memory module to get the object's info updated (e.g. player's location, visibility, reachability, etc.). The object will autoupdate itself.
The same principle is applied to all Maps returned by this memory module. Each returned Map is self-updating throughout the time. Once a specific Map is obtained (e.g. a map of visible enemies) from this memory module, the Map will get updated based on actions of the players (e.g. joining or leaving the game, changing their team, moving around the map, etc.) automatically.
Note: All Maps returned by this memory module are locked and can not be modified outside this memory module. If you need to modify a Map returned by this module (for your own specific purpose), create a duplicate first. Such duplicates, however and of course, will not get updated.
If you need to get info about players' deaths use Senses
module.
WARNING:It is totally unclear what UT2004 means by reachable!!!
It is designed to be initialized inside IUDKBotController.prepareBot(UDKBot)
method call
and may be used since IUDKBotController.botInitialized(cz.cuni.amis.pogamut.udk.communication.messages.gbinfomessages.GameInfo, cz.cuni.amis.pogamut.udk.communication.messages.gbinfomessages.ConfigChange, cz.cuni.amis.pogamut.udk.communication.messages.gbinfomessages.InitedMessage)
is called.
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 | |
---|---|
Players(UDKBot bot)
Constructor. |
|
Players(UDKBot bot,
Logger log)
Constructor. |
Method Summary | |
---|---|
boolean |
canReachEnemies()
Tells, whether the agent can reach any other enemies. |
boolean |
canReachFriends()
Tells, whether the agent can reach any other friends. |
boolean |
canReachPlayers()
Tells, whether the agent can reach any other players. |
boolean |
canSeeEnemies()
Tells, whether the agent sees any other enemies. |
boolean |
canSeeFriends()
Tells, whether the agent sees any other friends. |
boolean |
canSeePlayers()
Tells, whether the agent sees any other players. |
Map<UnrealId,Player> |
getEnemies()
Retreives a Map of all enemies. |
Map<UnrealId,Player> |
getFriends()
Retreives a Map of all friends. |
Player |
getNearestEnemy(double recentlyVisibleTime)
Returns nearest enemy that is visible or that was 'recently' visible. |
Player |
getNearestFriend(double recentlyVisibleTime)
Returns nearest friend that is visible or that was 'recently' visible. |
Player |
getNearestPlayer(double recently)
Returns nearest player that is visible or that was 'recently' visible. |
Player |
getNearestVisibleEnemy()
Returns nearest-visible enemy - if no enemy is visible returns null. |
Player |
getNearestVisibleFriend()
Returns nearest-visible friend - if no friend is visible returns null. |
Player |
getNearestVisiblePlayer()
Returns nearest-visible player - if no if no player is visible returns null. |
Player |
getNearestVisiblePlayer(Collection<Player> players)
Returns nearest-visible player to the bot from the collection of 'players' - if no player is visible returns null. |
Player |
getPlayer(UnrealId UnrealId)
Retreives last known info about given player. |
Map<UnrealId,Player> |
getPlayers()
Retreives a Map of all players. |
Player |
getRandomVisibleEnemy()
Returns random visible enemy - if no enemy is visible returns null. |
Player |
getRandomVisibleFriend()
Returns random friend - if no friend is visible returns null. |
Player |
getRandomVisiblePlayer()
Returns random visible player - if no if no player is visible returns null. |
Map<UnrealId,Player> |
getReachableEnemies()
Retreives a Map of all reachable enemies. |
Map<UnrealId,Player> |
getReachableFriends()
Retreives a Map of all reachable friends. |
Player |
getReachablePlayer(UnrealId UnrealId)
Retreives info about given player, but only it the player is reachable. |
Map<UnrealId,Player> |
getReachablePlayers()
Retreives a Map of all reachable players. |
Map<UnrealId,Player> |
getVisibleEnemies()
Retreives a Map of all visible enemies. |
Map<UnrealId,Player> |
getVisibleFriends()
Retreives a Map of all visible friends. |
Player |
getVisiblePlayer(UnrealId UnrealId)
Retreives info about given player, but only it the player is visible. |
Map<UnrealId,Player> |
getVisiblePlayers()
Retreives a Map of all visible players. |
boolean |
isEnemy(int team)
Tells, whether a given team is an enemy team to the agent. |
boolean |
isEnemy(Player player)
Tells, whether a given player is an enemy to the agent. |
boolean |
isFriend(int team)
Tells, whether a given team is a friend team to the agent. |
boolean |
isFriend(Player player)
Tells, whether a given player is a friend to the agent. |
protected void |
start(boolean startPaused)
Provides initialization of the module (clearing internal data structures). |
Methods inherited from class cz.cuni.amis.pogamut.base.agent.module.AgentModule |
---|
cleanUp, getComponentId, getLog, getState, initComponentId, isRunning, kill, pause, reset, resume, stop, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Players(UDKBot bot)
bot
- owner of the module that is using itpublic Players(UDKBot bot, Logger log)
bot
- owner of the module that is using itlog
- Logger to be used for logging runtime/debug info. If null, module creates its own logger.Method Detail |
---|
public Player getPlayer(UnrealId UnrealId)
Note: The returned Player object is self updating throughout time. Once you have a valid Player object, you do not have to call this method to get updated info about that player.
UnrealId
- Player UnrealId to be retreived.
getVisiblePlayer(UnrealId)
,
getReachablePlayer(UnrealId)
public Player getVisiblePlayer(UnrealId UnrealId)
Note: The returned Player object is self updating throughout time. Once you have a valid Player object, you do not have to call this method to get updated info about visibility of that player.
UnrealId
- Player UnrealId to be retrieved.
getPlayer(UnrealId)
,
getReachablePlayer(UnrealId)
public Player getReachablePlayer(UnrealId UnrealId)
WARNING:It is totally unclear what UT2004 means by reachable!!!
Note: The returned Player object is self updating throughout time. Once you have a valid Player object, you do not have to call this method to get updated info about reachability of that player.
UnrealId
- Player UnrealId to be retreived.
getPlayer(UnrealId)
,
getVisiblePlayer(UnrealId)
public Map<UnrealId,Player> getPlayers()
Note: The returned Map is unmodifiable and self updating throughout time. Once you obtain a specific Map of players from this memory module, the Map will get updated based on actions of the players (e.g. joining or leaving the game, changing their status, etc.).
getEnemies()
,
getFriends()
,
getVisiblePlayers()
,
getReachablePlayers()
public Map<UnrealId,Player> getEnemies()
Note: The returned Map is unmodifiable and self updating throughout time. Once you obtain a specific Map of enemies from this memory module, the Map will get updated based on actions of the players (e.g. joining or leaving the game, changing their team or status, etc.).
getPlayers()
,
getFriends()
,
getVisibleEnemies()
,
getReachableEnemies()
public Map<UnrealId,Player> getFriends()
Note: The returned Map is unmodifiable and self updating throughout time. Once you obtain a specific Map of friends from this memory module, the Map will get updated based on actions of the players (e.g. joining or leaving the game, changing their team or status, etc.).
getPlayers()
,
getEnemies()
,
getVisibleFriends()
,
getReachableFriends()
public Map<UnrealId,Player> getVisiblePlayers()
Note: The returned Map is unmodifiable and self updating throughout time. Once you obtain a specific Map of players from this memory module, the Map will get updated based on actions of the players (e.g. joining or leaving the game, or changing their visibility, etc.).
getPlayers()
,
getVisibleEnemies()
,
getVisibleFriends()
,
canSeePlayers()
public Map<UnrealId,Player> getVisibleEnemies()
Note: The returned Map is unmodifiable and self updating throughout time. Once you obtain a specific Map of enemies from this memory module, the Map will get updated based on actions of the players (e.g. joining or leaving the game, changing their team, status or visibility, etc.).
getEnemies()
,
getVisiblePlayers()
,
getVisibleFriends()
,
canSeeEnemies()
public Map<UnrealId,Player> getVisibleFriends()
Note: The returned Map is unmodifiable and self updating throughout time. Once you obtain a specific Map of friends from this memory module, the Map will get updated based on actions of the players (e.g. joining or leaving the game, changing their team, status or visibility, etc.).
getFriends()
,
getVisiblePlayers()
,
getVisibleEnemies()
,
canSeeFriends()
public Map<UnrealId,Player> getReachablePlayers()
WARNING:It is totally unclear what UT2004 means by reachable!!!
Note: The returned Map is unmodifiable and self updating throughout time. Once you obtain a specific Map of players from this memory module, the Map will get updated based on actions of the players (e.g. joining or leaving the game, or changing their visibility, etc.).
getPlayers()
,
getReachableEnemies()
,
getReachableFriends()
,
canReachPlayers()
public Map<UnrealId,Player> getReachableEnemies()
WARNING:It is totally unclear what UT2004 means by reachable!!!
Note: The returned Map is unmodifiable and self updating throughout time. Once you obtain a specific Map of enemies from this memory module, the Map will get updated based on actions of the players (e.g. joining or leaving the game, changing their team, status or visibility, etc.).
getEnemies()
,
getReachablePlayers()
,
getReachableFriends()
,
canReachEnemies()
public Map<UnrealId,Player> getReachableFriends()
WARNING:It is totally unclear what UT2004 means by reachable!!!
Note: The returned Map is unmodifiable and self updating throughout time. Once you obtain a specific Map of friends from this memory module, the Map will get updated based on actions of the players (e.g. joining or leaving the game, changing their team, status or visibility, etc.).
getFriends()
,
getReachablePlayers()
,
getReachableEnemies()
,
canReachFriends()
public Player getNearestPlayer(double recently)
recentlyVisibleTime
- how long the player may be non-visible
public Player getNearestEnemy(double recentlyVisibleTime)
recentlyVisibleTime
- how long the player may be non-visible
public Player getNearestFriend(double recentlyVisibleTime)
recentlyVisibleTime
- how long the player may be non-visible
public Player getNearestVisiblePlayer()
public Player getNearestVisibleEnemy()
public Player getNearestVisibleFriend()
public Player getNearestVisiblePlayer(Collection<Player> players)
players
- collection to go through
public Player getRandomVisiblePlayer()
public Player getRandomVisibleEnemy()
public Player getRandomVisibleFriend()
public boolean canSeePlayers()
getVisiblePlayers()
public boolean canSeeEnemies()
getVisibleEnemies()
public boolean canSeeFriends()
getVisibleFriends()
public boolean canReachPlayers()
WARNING:It is totally unclear what UT2004 means by reachable!!!
getReachablePlayers()
public boolean canReachEnemies()
WARNING:It is totally unclear what UT2004 means by reachable!!!
getReachableEnemies()
public boolean canReachFriends()
WARNING:It is totally unclear what UT2004 means by reachable!!!
getReachableFriends()
public boolean isEnemy(int team)
team
- Team number to be tested.
getTeam()
,
isFriend(int)
public boolean isEnemy(Player player)
player
- Player to be tested.
getTeam()
,
isFriend(Player)
public boolean isFriend(int team)
team
- Team number to be tested.
getTeam()
,
isEnemy(int)
public boolean isFriend(Player player)
player
- Player to be tested.
getTeam()
,
isEnemy(Player)
protected void start(boolean startPaused)
start
in class AgentModule<UDKBot>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |