File | Line |
---|
cz/cuni/amis/pogamut/udk/communication/translator/observer/state/NavPointListState.java | 48 |
cz/cuni/amis/pogamut/udk/communication/translator/server/state/NavPointListState.java | 48 |
public class NavPointListState extends AbstractServerFSMState<InfoMessage, TranslatorContext> {
private boolean begun = false;
private Map<UnrealId, NavPoint> navPoints = new HashMap<UnrealId, NavPoint>();
private Map<UnrealId, List<NavPointNeighbourLink>> neighbours = new HashMap<UnrealId, List<NavPointNeighbourLink>>();
private NavPoint currentNavPoint = null;
public NavPointListState() {
}
@Override
public void stateEntering(TranslatorContext context, IFSMState<InfoMessage, TranslatorContext> fromState, InfoMessage symbol) {
if (!begun) {
if (!symbol.getClass().equals(NavPointListStart.class)) throw new UnexpectedMessageException(TranslatorMessages.unexpectedMessage(this, symbol, NavPointListStart.class), context.getLogger(), this);
begun = true;
return;
}
if (!symbol.getClass().equals(NavPointNeighbourLinkEnd.class)) throw new UnexpectedMessageException(TranslatorMessages.unexpectedMessage(this, symbol, NavPointNeighbourLinkEnd.class), context.getLogger(), this);
navPoints.put(currentNavPoint.getId(), currentNavPoint);
neighbours.put(currentNavPoint.getId(), context.getNeighbours());
}
@Override
public void stateLeaving(TranslatorContext context,
IFSMState<InfoMessage, TranslatorContext> toState, InfoMessage symbol) {
if (symbol.getClass().equals(NavPointNeighbourLinkStart.class)) return;
if (!symbol.getClass().equals(NavPointListEnd.class)) throw new UnexpectedMessageException(TranslatorMessages.unexpectedMessage(this, symbol, NavPointListEnd.class), context.getLogger(), this);
// we've received all the navpoints we could!
context.setNavPoints(navPoints);
context.setNavPointLinks(neighbours);
context.processNavPointLinks();
if (context.getItems() != null && context.getItems().size() > 0) {
context.processNavPointsAndItems();
if (context.getLogger().isLoggable(Level.FINE)) context.getLogger().fine("Pushing NavPoint events.");
context.getEventQueue().pushEvent(context.getNavPoints().values().toArray(new IWorldChangeEvent[0]));
if (context.getLogger().isLoggable(Level.FINE)) context.getLogger().fine("Pushing Item events.");
context.getEventQueue().pushEvent(context.getItems().values().toArray(new IWorldChangeEvent[0]));
context.getEventQueue().pushEvent(new MapPointListObtained(context.getNavPoints(), context.getItems()));
} else {
if (context.getLogger().isLoggable(Level.FINE)) context.getLogger().fine("Pushing NavPoint events.");
context.getEventQueue().pushEvent(context.getNavPoints().values().toArray(new IWorldChangeEvent[0]));
}
// leaving the state, mark we haven't ever begun
navPoints = new HashMap<UnrealId, NavPoint>(navPoints.size() + 20);
neighbours = new HashMap<UnrealId, List<NavPointNeighbourLink>>(neighbours.size() + 20);
begun = false;
}
@Override
protected void innerStateSymbol(TranslatorContext context, InfoMessage symbol) {
if (!symbol.getClass().equals(NavPoint.class)) throw new UnexpectedMessageException(TranslatorMessages.unexpectedMessage(this, symbol, NavPoint.class), context.getLogger(), this);
currentNavPoint = (NavPoint)symbol;
}
@Override
public void init(TranslatorContext context) {
}
@Override
public void restart(TranslatorContext context) {
currentNavPoint = null;
begun = false;
navPoints = new HashMap<UnrealId, NavPoint>(navPoints.size() + 20);
neighbours = new HashMap<UnrealId, List<NavPointNeighbourLink>>(neighbours.size() + 20);
}
} |
File | Line |
---|
cz/cuni/amis/pogamut/udk/agent/navigation/loquenavigator/LoqueNavigator.java | 539 |
cz/cuni/amis/pogamut/udk/agent/navigation/martinnavigator/MartinNavigator.java | 389 |
);
}
// tell the executor that we have moved in the path to the next element
if (executor.getPathElementIndex() < 0) {
executor.switchToAnotherPathElement(0);
} else {
if (navigNextLocationOffset > 0) {
executor.switchToAnotherPathElement(executor.getPathElementIndex()+navigNextLocationOffset);
} else {
executor.switchToAnotherPathElement(executor.getPathElementIndex());
}
}
navigNextLocationOffset = 0;
return true;
}
private boolean isReachable(NavPoint node) {
if (node == null) return true;
int hDistance = (int) memory.getLocation().getDistance2D(node.getLocation());
int vDistance = (int) node.getLocation().getDistanceZ(memory.getLocation());
double angle;
if (hDistance == 0) {
angle = vDistance == 0 ? 0 : (vDistance > 0 ? Math.PI/2 : -Math.PI/2);
} else {
angle = Math.atan(vDistance / hDistance);
}
return Math.abs(vDistance) < 30 && Math.abs(angle) < Math.PI / 4;
}
/*========================================================================*/
/**
* Gets the link with movement information between two navigation points. Holds
* information about how we can traverse from the start to the end navigation
* point.
*
* @return NavPointNeighbourLink or null
*/
private NavPointNeighbourLink getNavPointsLink(NavPoint start, NavPoint end) {
if (start == null) {
//if start NavPoint is not provided, we try to find some
NavPoint tmp = getNavPoint(memory.getLocation());
if (tmp != null)
start = tmp;
else
return null;
}
if (end == null)
return null;
if (end.getIncomingEdges().containsKey(start.getId()))
return end.getIncomingEdges().get(start.getId());
return null;
}
/*========================================================================*/
/**
* Tries to navigate the agent safely to the current navigation node.
* @return Next stage of the navigation progress.
*/
private Stage navigToCurrentNode ()
{
if (navigCurrentNode != null) {
// update location of the current place we're reaching
navigCurrentLocation = navigCurrentNode.getLocation();
}
// get the distance from the current node
int localDistance = (int) memory.getLocation().getDistance(navigCurrentLocation.getLocation());
// get the distance from the current node (neglecting jumps)
int localDistance2 = (int) memory.getLocation().getDistance(
Location.add(navigCurrentLocation.getLocation(), new Location (0,0,100))
);
// where are we going to run to
Location firstLocation = navigCurrentLocation.getLocation();
// where we're going to continue
Location secondLocation = (navigNextNode != null && !navigNextNode.isLiftCenter() && !navigNextNode.isLiftCenter() ?
navigNextNode.getLocation() :
navigNextLocation);
// and what are we going to look at
Location focus = (navigNextLocation == null) ? firstLocation : navigNextLocation.getLocation();
// run to the current node..
if (!runner.runToLocation (firstLocation, secondLocation, focus, navigCurrentLink, (navigCurrentNode == null ? true : isReachable(navigCurrentNode)))) {
if (log != null && log.isLoggable(Level.FINE)) log.fine ("LoqueNavigator.navigToCurrentNode(): navigation to current node failed");
return Stage.CRASHED;
}
// we're still running
if (log != null && log.isLoggable(Level.FINEST)) log.finest ("LoqueNavigator.navigToCurrentNode(): traveling to current node, distance = " + localDistance); |
File | Line |
---|
cz/cuni/amis/pogamut/udk/communication/translator/bot/state/NavPointListState.java | 44 |
cz/cuni/amis/pogamut/udk/communication/translator/server/state/NavPointListState.java | 48 |
public class NavPointListState extends AbstractObserverFSMState<InfoMessage, TranslatorContext> {
private boolean begun = false;
private Map<UnrealId, NavPoint> navPoints = new HashMap<UnrealId, NavPoint>();
private Map<UnrealId, List<NavPointNeighbourLink>> neighbours = new HashMap<UnrealId, List<NavPointNeighbourLink>>();
private NavPoint currentNavPoint = null;
public NavPointListState() {
}
@Override
public void stateEntering(TranslatorContext context, IFSMState<InfoMessage, TranslatorContext> fromState, InfoMessage symbol) {
if (!begun) {
if (!symbol.getClass().equals(NavPointListStart.class)) throw new UnexpectedMessageException(TranslatorMessages.unexpectedMessage(this, symbol, NavPointListStart.class), context.getLogger(), this);
begun = true;
return;
}
if (!symbol.getClass().equals(NavPointNeighbourLinkEnd.class)) throw new UnexpectedMessageException(TranslatorMessages.unexpectedMessage(this, symbol, NavPointNeighbourLinkEnd.class), context.getLogger(), this);
navPoints.put(currentNavPoint.getId(), currentNavPoint);
neighbours.put(currentNavPoint.getId(), context.getNeighbours());
}
@Override
public void stateLeaving(TranslatorContext context,
IFSMState<InfoMessage, TranslatorContext> toState, InfoMessage symbol) {
if (symbol.getClass().equals(NavPointNeighbourLinkStart.class)) return;
if (!symbol.getClass().equals(NavPointListEnd.class)) throw new UnexpectedMessageException(TranslatorMessages.unexpectedMessage(this, symbol, NavPointListEnd.class), context.getLogger(), this);
// we've received all the navpoints we could!
context.setNavPoints(navPoints);
context.setNavPointLinks(neighbours);
context.processNavPointLinks(); |
File | Line |
---|
cz/cuni/amis/pogamut/udk/communication/translator/observer/support/ObserverListState.java | 44 |
cz/cuni/amis/pogamut/udk/communication/translator/server/support/ServerListState.java | 44 |
public ServerListState(Class beginMessage, Class<MESSAGE> message, Class endMessage) {
this.beginMessage = beginMessage;
this.message = message;
this.endMessage = endMessage;
}
protected List<MESSAGE> getList() {
return messages;
}
protected void newList() {
messages = new ArrayList<MESSAGE>();
}
@Override
public void init(CONTEXT context) {
messages = new ArrayList<MESSAGE>();
}
@Override
public void restart(CONTEXT context) {
messages = new ArrayList<MESSAGE>();
}
@Override
public void stateEntering(CONTEXT context, IFSMState<InfoMessage, CONTEXT> fromState, InfoMessage symbol) {
if (!symbol.getClass().equals(beginMessage)) throw new UnexpectedMessageException(TranslatorMessages.unexpectedMessage(this, symbol, beginMessage), context.getLogger(), this);
}
@Override
public void stateLeaving(CONTEXT context,
IFSMState<InfoMessage, CONTEXT> toState, InfoMessage symbol) {
if (!symbol.getClass().equals(endMessage)) throw new UnexpectedMessageException(TranslatorMessages.unexpectedMessage(this, symbol, endMessage), context.getLogger(), this);
}
@Override
protected void innerStateSymbol(CONTEXT context, InfoMessage symbol) {
if (!symbol.getClass().equals(message)) throw new UnexpectedMessageException(TranslatorMessages.unexpectedMessage(this, symbol, message), context.getLogger(), this);
messages.add(message.cast(symbol));
}
} |
File | Line |
---|
cz/cuni/amis/pogamut/udk/communication/translator/observer/state/ItemCategoryState.java | 29 |
cz/cuni/amis/pogamut/udk/communication/translator/server/state/ItemCategoryState.java | 29 |
public class ItemCategoryState extends AbstractServerFSMState<InfoMessage, TranslatorContext>{
@Override
public void init(TranslatorContext context) {
}
@Override
public void restart(TranslatorContext context) {
}
@Override
public void stateEntering(TranslatorContext context,
IFSMState<InfoMessage, TranslatorContext> fromState,
InfoMessage symbol) {
if (!(symbol instanceof ItemCategoryStart)) throw new UnexpectedMessageException(TranslatorMessages.unexpectedMessage(this, symbol, ItemCategoryStart.class), context.getLogger(), this);
}
@Override
public void stateLeaving(TranslatorContext context,
IFSMState<InfoMessage, TranslatorContext> toState, InfoMessage symbol) {
if (!(symbol instanceof ItemCategoryEnd)) throw new UnexpectedMessageException(TranslatorMessages.unexpectedMessage(this, symbol, ItemCategoryEnd.class), context.getLogger(), this);
}
@Override
protected void innerStateSymbol(TranslatorContext context, InfoMessage symbol) {
if (!(symbol instanceof ItemCategory)) throw new UnexpectedMessageException(TranslatorMessages.unexpectedMessage(this, symbol, ItemCategory.class), context.getLogger(), this);
ItemDescriptor desc = context.getItemTranslator().createDescriptor((ItemCategory)symbol);
context.getEventQueue().pushEvent(new ItemDescriptorObtained(desc));
}
} |
File | Line |
---|
cz/cuni/amis/pogamut/udk/communication/translator/bot/support/BotListState.java | 44 |
cz/cuni/amis/pogamut/udk/communication/translator/server/support/ServerListState.java | 44 |
public ObserverListState(Class beginMessage, Class<MESSAGE> message, Class endMessage) {
this.beginMessage = beginMessage;
this.message = message;
this.endMessage = endMessage;
}
protected List<MESSAGE> getList() {
return messages;
}
protected void newList() {
messages = new ArrayList<MESSAGE>();
}
@Override
public void init(CONTEXT context) {
messages = new ArrayList<MESSAGE>();
}
@Override
public void restart(CONTEXT context) {
messages = new ArrayList<MESSAGE>();
}
@Override
public void stateEntering(CONTEXT context, IFSMState<InfoMessage, CONTEXT> fromState, InfoMessage symbol) {
if (!symbol.getClass().equals(beginMessage)) throw new UnexpectedMessageException(TranslatorMessages.unexpectedMessage(this, symbol, beginMessage), context.getLogger(), this);
}
@Override
public void stateLeaving(CONTEXT context,
IFSMState<InfoMessage, CONTEXT> toState, InfoMessage symbol) {
if (!symbol.getClass().equals(endMessage)) throw new UnexpectedMessageException(TranslatorMessages.unexpectedMessage(this, symbol, endMessage), context.getLogger(), this);
}
@Override |
File | Line |
---|
cz/cuni/amis/pogamut/udk/observer/impl/AbstractUDKObserver.java | 78 |
cz/cuni/amis/pogamut/udk/server/impl/AbstractUDKServer.java | 135 |
}
/**
* Specify the password that should be used if required by the world.
*
* @param password
*/
public void setPassword(String password) {
this.desiredPassword = password;
}
// --------------
// -=-=-=-=-=-=-=
// READY LISTENER
// -=-=-=-=-=-=-=
// --------------
/**
* This method is called whenever HelloBot message is parsed - the
* GameBots2004 is awaiting the bot to reply with Ready command to begin the
* handshake.
*/
protected void readyCommandRequested() {
getAct().act(new Ready());
}
/**
* Listener that is hooked to WorldView awaiting event ReadyCommandRequest
* calling setupWorldViewListeners() and then readyCommandRequested() method
* upon receiving the event.
*/
private IWorldEventListener<ReadyCommandRequest> readyCommandRequestListener = new IWorldEventListener<ReadyCommandRequest>() {
@Override
public void notify(ReadyCommandRequest event) {
setState(new AgentStateStarting("GameBots2004 greeted us, sending READY."));
readyCommandRequested();
setState(new AgentStateStarting("READY sent."));
}
};
// -----------------
// -=-=-=-=-=-=-=-=-
// PASSWORD LISTENER
// -=-=-=-=-=-=-=-=-
// -----------------
/**
* Instance of the password reply command that was sent upon receivieng
* request for the password (the world is locked).
* <p>
* <p>
* If null the password was not required by the time the bot connected to
* the world.
*/
private PasswordReply passwordReply = null;
/**
* Instance of the password reply command that was sent upon receivieng
* request for the password (the world is locked).
* <p>
* <p>
* If null the password was not required by the time the bot connected to
* the world.
*
* @return
*/
public PasswordReply getPasswordReply() {
return passwordReply;
}
/**
* This method is called whenever the Password event is caught telling us
* the world is locked and is requiring a password.
* <p>
* <p>
* May return null - in that case an empty password is sent to the server
* (which will probably result in closing the connection and termination of
* the agent).
* <p>
* <p>
* This message is then saved to private field passwordReply and is
* accessible via getPasswordReply() method if required to be probed during
* the bot's runtime.
* <p>
* <p>
* Note that if setPassword() method is called before this one it will use
* provided password via that method.
*/
protected PasswordReply createPasswordReply() {
return desiredPassword != null ? new PasswordReply(desiredPassword)
: null;
}
/**
* Listener that is hooked to WorldView awaiting event InitCommandRequest
* calling initCommandRequested() method upon receiving the event.
*/
private IWorldEventListener<Password> passwordRequestedListener = new IWorldEventListener<Password>() {
@Override
public void notify(Password event) {
setState(new AgentStateStarting("Password requested by the world."));
passwordReply = createPasswordReply();
if (passwordReply == null) {
passwordReply = new PasswordReply("");
}
if (log.isLoggable(Level.INFO)) log.info("Password required for the world, replying with '"
+ passwordReply.getPassword() + "'.");
getAct().act(passwordReply);
}
}; |
File | Line |
---|
cz/cuni/amis/pogamut/udk/communication/translator/observer/state/PasswordState.java | 31 |
cz/cuni/amis/pogamut/udk/communication/translator/server/state/PasswordState.java | 31 |
public class PasswordState extends AbstractServerFSMState<InfoMessage, TranslatorContext> {
@Override
public void init(TranslatorContext context) {
}
@Override
public void restart(TranslatorContext context) {
}
@Override
public void stateEntering(TranslatorContext context,
IFSMState<InfoMessage, TranslatorContext> fromState,
InfoMessage symbol) {
if (!(symbol instanceof Password)) throw new UnexpectedMessageException(TranslatorMessages.unexpectedMessage(this, symbol, Password.class), context.getLogger(), this);
if (!(symbol instanceof IWorldChangeEvent)) throw new UnexpectedMessageException(TranslatorMessages.messageNotWorldEvent(this, symbol), context.getLogger(), this);
context.getEventQueue().pushEvent((IWorldChangeEvent)symbol);
}
@Override
public void stateLeaving(TranslatorContext context,
IFSMState<InfoMessage, TranslatorContext> toState, InfoMessage symbol) {
}
@Override
protected void innerStateSymbol(TranslatorContext context, InfoMessage symbol) {
if (!(symbol instanceof Password)) throw new UnexpectedMessageException(TranslatorMessages.unexpectedMessage(this, symbol), context.getLogger(), this);
}
} |
File | Line |
---|
cz/cuni/amis/pogamut/udk/communication/translator/observer/state/ItemListState.java | 57 |
cz/cuni/amis/pogamut/udk/communication/translator/server/state/ItemListState.java | 56 |
if (context.getLogger().isLoggable(Level.FINE)) context.getLogger().fine("Pushing NavPoint events.");
context.getEventQueue().pushEvent(context.getNavPoints().values().toArray(new IWorldChangeEvent[0]));
if (context.getLogger().isLoggable(Level.FINE)) context.getLogger().fine("Pushing Item events.");
context.getEventQueue().pushEvent(context.getItems().values().toArray(new IWorldChangeEvent[0]));
context.getEventQueue().pushEvent(new MapPointListObtained(context.getNavPoints(), context.getItems()));
} else {
if (context.getLogger().isLoggable(Level.FINE)) context.getLogger().fine("Pushing Item events.");
context.getEventQueue().pushEvent(context.getItems().values().toArray(new IWorldChangeEvent[0]));
}
}
} |
File | Line |
---|
cz/cuni/amis/pogamut/udk/communication/translator/observer/state/ObserverRunningState.java | 58 |
cz/cuni/amis/pogamut/udk/communication/translator/server/state/ServerRunningState.java | 64 |
public class ServerRunningState extends AbstractServerFSMState<InfoMessage, TranslatorContext> {
@Override
public void stateEntering(TranslatorContext context, IFSMState<InfoMessage, TranslatorContext> arg1, InfoMessage arg2) {
}
@Override
protected void innerStateSymbol(TranslatorContext context, InfoMessage obj) {
if (obj instanceof IWorldChangeEvent) {
if (obj instanceof HandShakeEnd) {
context.getEventQueue().pushEvent(new MapPointListObtained(context.getNavPoints(), context.getItems()));
} else {
context.getEventQueue().pushEvent((IWorldChangeEvent) obj);
}
} else {
throw new UnexpectedMessageException(TranslatorMessages.messageNotWorldEvent(this, obj), context.getLogger(), this);
}
}
@Override
public void stateLeaving(TranslatorContext context, IFSMState<InfoMessage, TranslatorContext> arg1, InfoMessage symbol) {
}
@Override
public void init(TranslatorContext arg0) {
}
@Override
public void restart(TranslatorContext arg0) {
}
} |
File | Line |
---|
cz/cuni/amis/pogamut/udk/communication/translator/itemdescriptor/AmmoDescriptor.java | 67 |
cz/cuni/amis/pogamut/udk/communication/translator/itemdescriptor/WeaponDescriptor.java | 453 |
}
/**
* Initial amount of ammunition. We get this if we pick up the item for the
* first time.
*
* @return priInitialAmount
*/
public int getPriInitialAmount() {
return priInitialAmount;
}
/**
* Maximum amount of this ammunition we can hold in our inventory.
*
* @return priMaxAmount
*/
public int getPriMaxAmount() {
return priMaxAmount;
}
/**
* Maximum firing range. 0 if not limited - probably.
*
* @return priMaxRange
* @todo Find out how this works.
*/
public double getPriMaxRange() {
return priMaxRange;
}
/**
* Class of this ammunitions damage type. If ammo is not none, then this
* shouldn't be none either.
*
* @return priDamageType
*/
public String getPriDamageType() {
return priDamageType;
}
/**
* If this damage can be stopped by an armor.
*
* @return priArmorStops
*/
public boolean isPriArmorStops() {
return priArmorStops;
}
/**
* If this damage will kill us instantly.
*
* @return priAlwaysGibs
*/
public boolean isPriAlwaysGibs() {
return priAlwaysGibs;
}
/**
* If this damage is special.
*
* @return priSpecial
* @todo find out what it is.
*/
public boolean isPriSpecial() {
return priSpecial;
}
/**
* If this damage can detonate goop created by bio rifle (not sure).
*
* @return priDetonatesGoop
* @todo Find out correct info.
*/
public boolean isPriDetonatesGoop() {
return priDetonatesGoop;
}
/**
* If this damage is caused by super weapon and will damage also team mates
* even if friendly fire is off.
*
* @return priSuperWeapon
*/
public boolean isPriSuperWeapon() {
return priSuperWeapon;
}
/**
* If the hit by this damage will add some speed to the target (will "push"
* the target a bit).
*
* @return priExtraMomZ
*/
public boolean isPriExtraMomZ() {
return priExtraMomZ;
}
/**
* Holds the class of the projectile of this firing mode. If none, then the
* mode does not spawn projectiles. all the info below is then not relevant
* and will have default values on.
*
* @return priProjType
*/
public String getPriProjType() {
return priProjType;
}
/**
* Damage of the projectile.
*
* @return priDamage
*/
public double getPriDamage() {
return priDamage;
}
/**
* Default speed of the projectile - probably the projectile has this speed
* when fired.
*
* @return priSpeed
*/
public double getPriSpeed() {
return priSpeed;
}
/**
* Maximum possible speed of this projectile.
*
* @return priMaxSpeed
*/
public double getPriMaxSpeed() {
return priMaxSpeed;
}
/**
* Life span of this projectile. How long the projectile lasts in the
* environment. If 0 than probably unlimited.
*
* @return priLifeSpan
*/
public double getPriLifeSpan() {
return priLifeSpan;
}
/**
* If the projectile does splash damage, the value here won't be zero and
* will specify the radius of the splash damage in ut units.
*
* @return priDamageRadius
*/
public double getPriDamageRadius() {
return priDamageRadius;
}
/**
* Probably the amount of speed added to Z velocity vector when this
* projectile is fired. In UT units.
*
* @return priTossZ
* @todo Find out correct info.
*/
public double getPriTossZ() {
return priTossZ;
}
/**
* Maximum effective distance of the projectile. Probably 0 if not limited.
*
* @return priMaxEffectDistance
* @todo Find out correct info.
*/
public double getPriMaxEffectDistance() {
return priMaxEffectDistance;
} |
File | Line |
---|
cz/cuni/amis/pogamut/udk/communication/translator/observer/state/NavPointListState.java | 84 |
cz/cuni/amis/pogamut/udk/communication/translator/server/state/ItemListState.java | 54 |
if (context.getNavPoints() != null && context.getNavPoints().size() != 0) {
context.processNavPointsAndItems();
if (context.getLogger().isLoggable(Level.FINE)) context.getLogger().fine("Pushing NavPoint events.");
context.getEventQueue().pushEvent(context.getNavPoints().values().toArray(new IWorldChangeEvent[0]));
if (context.getLogger().isLoggable(Level.FINE)) context.getLogger().fine("Pushing Item events.");
context.getEventQueue().pushEvent(context.getItems().values().toArray(new IWorldChangeEvent[0]));
context.getEventQueue().pushEvent(new MapPointListObtained(context.getNavPoints(), context.getItems()));
} else {
if (context.getLogger().isLoggable(Level.FINE)) context.getLogger().fine("Pushing Item events."); |
File | Line |
---|
cz/cuni/amis/pogamut/udk/communication/translator/observer/state/MutatorListState.java | 27 |
cz/cuni/amis/pogamut/udk/communication/translator/server/state/MutatorListState.java | 27 |
public class MutatorListState extends ServerListState<Mutator, TranslatorContext>{
public MutatorListState() {
super(MutatorListStart.class, Mutator.class, MutatorListEnd.class);
}
@Override
public void stateEntering(TranslatorContext context, IFSMState<InfoMessage, TranslatorContext> fromState, InfoMessage symbol) {
super.restart(context);
super.stateEntering(context, fromState, symbol);
}
@Override
public void stateLeaving(TranslatorContext context, IFSMState<InfoMessage, TranslatorContext> toState, InfoMessage symbol) {
super.stateLeaving(context, toState, symbol);
context.getEventQueue().pushEvent(new MutatorListObtained(getList()));
newList();
}
@Override
protected void innerStateSymbol(TranslatorContext context,
InfoMessage symbol) {
super.innerStateSymbol(context, symbol);
if (symbol instanceof Mutator) {
context.getEventQueue().pushEvent((Mutator)symbol);
}
}
} |
File | Line |
---|
cz/cuni/amis/pogamut/udk/communication/messages/gbinfomessages/FlagInfo.java | 443 |
cz/cuni/amis/pogamut/udk/communication/messages/gbinfomessages/Mover.java | 604 |
updated = true;
}
if (!SafeEquals.equals(o.State, State)) {
o.State=State;
updated = true;
}
o.Time = Time;
if (updated) {
return new IWorldObjectUpdateResult.WorldObjectUpdateResult(cz.cuni.amis.pogamut.base.communication.translator.event.IWorldObjectUpdateResult.Result.UPDATED, o);
} else {
return new IWorldObjectUpdateResult.WorldObjectUpdateResult(cz.cuni.amis.pogamut.base.communication.translator.event.IWorldObjectUpdateResult.Result.SAME, o);
}
}
/**
* 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).
*/
public IWorldObject getObject() {
if (orig == null) return this;
return orig;
}
public String toString() {
return
super.toString() + " | " +
"Id = " +
String.valueOf(Id) + " | " +
"Location = " +
String.valueOf(Location) + " | " + |
File | Line |
---|
cz/cuni/amis/pogamut/udk/communication/translator/observer/state/ItemListState.java | 57 |
cz/cuni/amis/pogamut/udk/communication/translator/server/state/NavPointListState.java | 86 |
if (context.getLogger().isLoggable(Level.FINE)) context.getLogger().fine("Pushing NavPoint events.");
context.getEventQueue().pushEvent(context.getNavPoints().values().toArray(new IWorldChangeEvent[0]));
if (context.getLogger().isLoggable(Level.FINE)) context.getLogger().fine("Pushing Item events.");
context.getEventQueue().pushEvent(context.getItems().values().toArray(new IWorldChangeEvent[0]));
context.getEventQueue().pushEvent(new MapPointListObtained(context.getNavPoints(), context.getItems()));
} else {
if (context.getLogger().isLoggable(Level.FINE)) context.getLogger().fine("Pushing NavPoint events."); |
File | Line |
---|
cz/cuni/amis/pogamut/udk/communication/translator/bot/state/PasswordState.java | 32 |
cz/cuni/amis/pogamut/udk/communication/translator/server/state/PasswordState.java | 31 |
public class PasswordState extends AbstractObserverFSMState<InfoMessage, TranslatorContext> {
@Override
public void init(TranslatorContext context) {
}
@Override
public void restart(TranslatorContext context) {
}
@Override
public void stateEntering(TranslatorContext context,
IFSMState<InfoMessage, TranslatorContext> fromState,
InfoMessage symbol) {
if (!(symbol instanceof Password)) throw new UnexpectedMessageException(TranslatorMessages.unexpectedMessage(this, symbol, Password.class), context.getLogger(), this);
if (!(symbol instanceof IWorldChangeEvent)) throw new UnexpectedMessageException(TranslatorMessages.messageNotWorldEvent(this, symbol), context.getLogger(), this);
context.getEventQueue().pushEvent((IWorldChangeEvent)symbol);
}
@Override
public void stateLeaving(TranslatorContext context,
IFSMState<InfoMessage, TranslatorContext> toState, InfoMessage symbol) {
}
@Override |
File | Line |
---|
cz/cuni/amis/pogamut/udk/communication/translator/observer/support/ObserverMessageExpectedState.java | 26 |
cz/cuni/amis/pogamut/udk/communication/translator/server/support/ServerMessageExpectedState.java | 26 |
public ServerMessageExpectedState(Class expectedMessage) {
message = expectedMessage;
}
@Override
public void init(CONTEXT context) {
}
@Override
public void restart(CONTEXT context) {
}
@Override
public void stateEntering(CONTEXT context,
IFSMState<InfoMessage, CONTEXT> fromState, InfoMessage symbol) {
}
@Override
public void stateLeaving(CONTEXT context, IFSMState<InfoMessage, CONTEXT> toState, InfoMessage symbol) {
if (!symbol.getClass().equals(message)) throw new UnexpectedMessageException(TranslatorMessages.unexpectedMessage(this, symbol), context.getLogger(), this);
}
@Override
protected void innerStateSymbol(CONTEXT context, InfoMessage symbol) {
throw new UnexpectedMessageException(TranslatorMessages.unexpectedMessage(this, symbol), context.getLogger(), this);
}
} |
File | Line |
---|
cz/cuni/amis/pogamut/udk/communication/messages/gbinfomessages/ConfigChange.java | 648 |
cz/cuni/amis/pogamut/udk/communication/messages/gbinfomessages/Self.java | 874 |
updated = true;
}
if (!SafeEquals.equals(o.Action, Action)) {
o.Action=Action;
updated = true;
}
o.Time = Time;
if (updated) {
return new IWorldObjectUpdateResult.WorldObjectUpdateResult(cz.cuni.amis.pogamut.base.communication.translator.event.IWorldObjectUpdateResult.Result.UPDATED, o);
} else {
return new IWorldObjectUpdateResult.WorldObjectUpdateResult(cz.cuni.amis.pogamut.base.communication.translator.event.IWorldObjectUpdateResult.Result.SAME, o);
}
}
/**
* 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).
*/
public IWorldObject getObject() {
if (orig == null) return this;
return orig;
}
public String toString() {
return
super.toString() + " | " +
"Id = " +
String.valueOf(Id) + " | " + |
File | Line |
---|
cz/cuni/amis/pogamut/udk/agent/navigation/loquenavigator/LoqueNavigator.java | 229 |
cz/cuni/amis/pogamut/udk/agent/navigation/martinnavigator/MartinNavigator.java | 190 |
}
/*========================================================================*/
/**
* Tries to navigate the agent directly to the navig destination.
* @return Next stage of the navigation progress.
*/
private Stage navigDirectly ()
{
// get the distance from the target
int distance = (int) memory.getLocation().getDistance(navigDestination);
// are we there yet?
if (distance <= getPrecision())
{
if (log != null && log.isLoggable(Level.FINE)) log.fine ("LoqueNavigator.navigDirectly(): destination close enough: " + distance);
return Stage.COMPLETED;
}
// run to that location..
if (!runner.runToLocation (navigDestination, null, navigDestination, null, true))
{
if (log != null && log.isLoggable(Level.FINE)) log.fine ("LoqueNavigator.navigDirectly(): direct navigation failed");
return Stage.CRASHED;
}
// well, we're still running
if (log != null && log.isLoggable(Level.FINEST)) log.finest ("LoqueNavigator.navigDirectly(): traveling directly, distance = " + distance);
return navigStage;
}
/*========================================================================*/
/**
* Iterator through navigation path.
*/
private Iterator<PATH_ELEMENT> navigIterator = null;
/**
* How many path elements we have iterated over before selecting the current {@link MartinNavigator#navigNextLocation}.
*/
private int navigNextLocationOffset = 0;
/**
* Current node in the path (the one the agent is running to).
*/
private Location navigCurrentLocation = null; |
File | Line |
---|
cz/cuni/amis/pogamut/udk/communication/translator/observer/state/ObserverRunningState.java | 26 |
cz/cuni/amis/pogamut/udk/communication/translator/server/state/ServerRunningState.java | 27 |
@FSMState(map = {
@FSMTransition(
state=ItemCategoryState.class,
symbol={ItemCategoryStart.class},
transition={}
),
@FSMTransition(
state=MutatorListState.class,
symbol={MutatorListStart.class},
transition={}),
@FSMTransition(
state = NavPointListState.class,
symbol = { NavPointListStart.class },
transition = {}
),
@FSMTransition(
state = ItemListState.class,
symbol = { ItemListStart.class },
transition = {}
),
@FSMTransition(
state = PlayerListState.class,
symbol = { PlayerListStart.class },
transition = {}
),
@FSMTransition(
state = MapListState.class,
symbol = { MapListStart.class },
transition = {}
), |
File | Line |
---|
cz/cuni/amis/pogamut/udk/communication/translator/bot/state/ItemCategoryState.java | 29 |
cz/cuni/amis/pogamut/udk/communication/translator/observer/state/ItemCategoryState.java | 29 |
public class ItemCategoryState extends AbstractObserverFSMState<InfoMessage, TranslatorContext>{
@Override
public void init(TranslatorContext context) {
}
@Override
public void restart(TranslatorContext context) {
}
@Override
public void stateEntering(TranslatorContext context,
IFSMState<InfoMessage, TranslatorContext> fromState,
InfoMessage symbol) {
if (!(symbol instanceof ItemCategoryStart)) throw new UnexpectedMessageException(TranslatorMessages.unexpectedMessage(this, symbol, ItemCategoryStart.class), context.getLogger(), this);
}
@Override
public void stateLeaving(TranslatorContext context,
IFSMState<InfoMessage, TranslatorContext> toState, InfoMessage symbol) {
if (!(symbol instanceof ItemCategoryEnd)) throw new UnexpectedMessageException(TranslatorMessages.unexpectedMessage(this, symbol, ItemCategoryEnd.class), context.getLogger(), this);
}
@Override |
File | Line |
---|
cz/cuni/amis/pogamut/udk/agent/navigation/UDKPathExecutor.java | 61 |
cz/cuni/amis/pogamut/udk/agent/navigation/UDKPathExecutorWithPlanner.java | 60 |
public UDKPathExecutorWithPlanner(UDKBot bot, IPathPlanner<PATH_ELEMENT> pathPlanner, IUDKPathNavigator<PATH_ELEMENT> navigator, Logger log) {
super(log);
if (getLog() == null) {
setLog(bot.getLogger().getCategory(getClass().getSimpleName()));
}
NullCheck.check(bot, "bot");
this.bot = bot;
this.navigator = navigator;
if (this.navigator == null) {
this.navigator = new LoqueNavigator<PATH_ELEMENT>(bot, getLog());
}
this.navigator.setBot(bot);
this.navigator.setExecutor(this);
bot.getWorldView().addObjectListener(Self.class, WorldObjectFirstEncounteredEvent.class, selfListener);
bot.getWorldView().addEventListener(EndMessage.class, endMessageListener); |
File | Line |
---|
cz/cuni/amis/pogamut/udk/communication/translator/bot/state/PathAcceptState.java | 32 |
cz/cuni/amis/pogamut/udk/communication/translator/observer/state/PathAcceptState.java | 27 |
public class PathAcceptState extends ServerListState<PathList, TranslatorContext> {
private String pathId = null;
public PathAcceptState() {
super(PathListStart.class, PathList.class, PathListEnd.class);
}
@Override
public void stateEntering(TranslatorContext context, IFSMState<InfoMessage, TranslatorContext> fromState, InfoMessage symbol) {
super.stateEntering(context, fromState, symbol);
pathId = ((PathListStart)symbol).getMessageId();
}
@Override
public void stateLeaving(TranslatorContext context, IFSMState<InfoMessage, TranslatorContext> toState, InfoMessage symbol) {
super.stateLeaving(context, toState, symbol);
context.getEventQueue().pushEvent(new Path(pathId, getList()));
getList().clear();
}
} |
File | Line |
---|
cz/cuni/amis/pogamut/udk/communication/messages/gbinfomessages/FlagInfo.java | 448 |
cz/cuni/amis/pogamut/udk/communication/messages/gbinfomessages/NavPoint.java | 1077 |
updated = true;
}
o.Time = Time;
if (updated) {
return new IWorldObjectUpdateResult.WorldObjectUpdateResult(cz.cuni.amis.pogamut.base.communication.translator.event.IWorldObjectUpdateResult.Result.UPDATED, o);
} else {
return new IWorldObjectUpdateResult.WorldObjectUpdateResult(cz.cuni.amis.pogamut.base.communication.translator.event.IWorldObjectUpdateResult.Result.SAME, o);
}
}
/**
* 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).
*/
public IWorldObject getObject() {
if (orig == null) return this;
return orig;
}
public String toString() {
return
super.toString() + " | " +
"Id = " +
String.valueOf(Id) + " | " +
"Location = " +
String.valueOf(Location) + " | " + |
File | Line |
---|
cz/cuni/amis/pogamut/udk/communication/translator/observer/state/ItemListState.java | 32 |
cz/cuni/amis/pogamut/udk/communication/translator/server/state/ItemListState.java | 32 |
public class ItemListState extends ServerListState<Item, TranslatorContext> {
public ItemListState() {
super(ItemListStart.class, Item.class, ItemListEnd.class);
}
@Override
public void stateLeaving(TranslatorContext translatorContext,
IFSMState<InfoMessage, TranslatorContext> toState, InfoMessage symbol) {
processItems(translatorContext.getNavPoints(), getList(), translatorContext);
newList();
}
private void processItems(Map<UnrealId, NavPoint> origNavPoints, List<Item> list, TranslatorContext context) {
Map<UnrealId, Item> items = new HashMap<UnrealId, Item>();
for (Item item : list) {
items.put(item.getId(), item);
}
context.setItems(items); |
File | Line |
---|
cz/cuni/amis/pogamut/udk/agent/navigation/UDKPathExecutor.java | 109 |
cz/cuni/amis/pogamut/udk/agent/navigation/UDKPathExecutorWithPlanner.java | 95 |
navigator.newPath(getPath());
}
}
@Override
protected void pathComputationFailedImpl() {
}
@Override
protected void stuckImpl() {
navigator.reset();
}
/**
* Sets the path into the GB2004 via {@link SetRoute} whenever switch occurs and the rest of the path is greater than
* 32 path elements.
*/
@Override
protected void switchToAnotherPathElementImpl() {
List<PATH_ELEMENT> path = getPath();
if (path.size() > 31 + getPathElementIndex()) {
List<PATH_ELEMENT> pathPart = new ArrayList<PATH_ELEMENT>(32);
for (int i = getPathElementIndex(); i < path.size() && i < getPathElementIndex() + 31; ++i) {
pathPart.add(path.get(i));
}
bot.getAct().act(new SetRoute().setRoute(pathPart));
}
} |
File | Line |
---|
cz/cuni/amis/pogamut/udk/agent/navigation/loquenavigator/LoqueNavigator.java | 620 |
cz/cuni/amis/pogamut/udk/agent/navigation/loquenavigator/LoqueNavigator.java | 838 |
Location firstLocation = navigCurrentLocation.getLocation();
// where we're going to continue
Location secondLocation = (navigNextNode != null && !navigNextNode.isLiftCenter() && !navigNextNode.isLiftCenter() ?
navigNextNode.getLocation() :
navigNextLocation);
// and what are we going to look at
Location focus = (navigNextLocation == null) ? firstLocation : navigNextLocation.getLocation();
// run to the current node..
if (!runner.runToLocation (firstLocation, secondLocation, focus, navigCurrentLink, (navigCurrentNode == null ? true : isReachable(navigCurrentNode)))) {
if (log != null && log.isLoggable(Level.FINE)) log.fine ("LoqueNavigator.navigToCurrentNode(): navigation to current node failed");
return Stage.CRASHED;
}
// we're still running
if (log != null && log.isLoggable(Level.FINEST)) log.finest ("LoqueNavigator.navigToCurrentNode(): traveling to current node"); |
File | Line |
---|
cz/cuni/amis/pogamut/udk/communication/translator/itemdescriptor/AmmoDescriptor.java | 11 |
cz/cuni/amis/pogamut/udk/communication/translator/itemdescriptor/WeaponDescriptor.java | 67 |
@ItemDescriptorField
private String priAmmoType;
@ItemDescriptorField
private int priInitialAmount = 0;
@ItemDescriptorField
private int priMaxAmount = 0;
@ItemDescriptorField
private double priMaxRange = 0;
// Primary firing mode ammo damage type
@ItemDescriptorField
private String priDamageType;
@ItemDescriptorField
private boolean priArmorStops = true;
@ItemDescriptorField
private boolean priAlwaysGibs = false;
@ItemDescriptorField
private boolean priSpecial = false;
@ItemDescriptorField
private boolean priDetonatesGoop = false;
@ItemDescriptorField
private boolean priSuperWeapon = false;
@ItemDescriptorField
private boolean priExtraMomZ = false;
// Primary firing mode projectile
@ItemDescriptorField
private String priProjType;
@ItemDescriptorField
private double priDamage = 0;
@ItemDescriptorField
private double priSpeed = 0;
@ItemDescriptorField
private double priMaxSpeed = 0;
@ItemDescriptorField
private double priLifeSpan = 0;
@ItemDescriptorField
private double priDamageRadius = 0;
@ItemDescriptorField
private double priTossZ = 0;
@ItemDescriptorField
private double priMaxEffectDistance = 0;
// Secondary firing mode
@ItemDescriptorField |
File | Line |
---|
cz/cuni/amis/pogamut/udk/factory/direct/remoteagent/UDKObserverFactory.java | 49 |
cz/cuni/amis/pogamut/udk/factory/direct/remoteagent/UDKServerFactory.java | 49 |
public UDKServer newAgent(PARAMS agentParameters) throws PogamutException {
// setup loger
AgentLogger logger = new AgentLogger(agentParameters.getAgentId());
// Since default agent logger doesn't write anything, platform can be exposed to silent fail
// i.e. RuntimeException that is thrown, something happens and whole thing stops working
// without user knowing what the error message was.
logger.setLevel(Level.SEVERE);
logger.addDefaultConsoleHandler();
IComponentBus eventBus = new ComponentBus(logger);
///////////////////////////////
/// WORLD -> AGENT ///
///////////////////////////////
// create connection to the world
SocketConnection socketConnection = new SocketConnection((ISocketConnectionAddress)agentParameters.getWorldAddress(), new ComponentDependencies(ComponentDependencyType.STARTS_WITH).add(agentParameters.getAgentId()), eventBus, logger);
UnrealIdTranslator unrealIdTranslator = new UnrealIdTranslator();
ItemTranslator itemTranslator = new ItemTranslator();
// parser for translating text messages into Java objects
IWorldMessageParser parser = new UDKParser(unrealIdTranslator, itemTranslator, socketConnection, new Yylex(), new IYylexObserver.LogObserver(logger), eventBus, logger);
// translates sets of messages wrapped in Java objects into agregared messages
IWorldMessageTranslator messageTranslator = new ServerFSM(itemTranslator, logger); |
File | Line |
---|
cz/cuni/amis/pogamut/udk/agent/navigation/loquenavigator/LoqueNavigator.java | 474 |
cz/cuni/amis/pogamut/udk/agent/navigation/martinnavigator/MartinNavigator.java | 345 |
NavPoint navigLastNode = navigCurrentNode;
// get the next prepared node
if (null == (navigCurrentLocation = navigNextLocation))
{
// no nodes left there..
if (log != null && log.isLoggable(Level.FINER)) log.finer ("Navigator.switchToNextNode(): no nodes left");
navigCurrentNode = null;
return false;
}
// rewrite the navpoint as well
navigCurrentNode = navigNextNode;
// store current NavPoint link
navigCurrentLink = getNavPointsLink(navigLastNode, navigCurrentNode);
// ensure that the last node is not null
if (navigLastLocation == null) {
navigLastLocation = navigCurrentLocation;
navigLastNode = navigCurrentNode;
}
// get next node distance
int localDistance = (int) memory.getLocation().getDistance(navigCurrentLocation.getLocation());
if (navigCurrentNode == null) {
// we do not have extra information about the location we're going to reach
runner.reset();
if (log != null && log.isLoggable(Level.FINE))
log.fine (
"LoqueNavigator.switchToNextNode(): switch to next location " + navigCurrentLocation
+ ", distance " + localDistance |
File | Line |
---|
cz/cuni/amis/pogamut/udk/communication/messages/gbinfomessages/FlagInfo.java | 372 |
cz/cuni/amis/pogamut/udk/communication/messages/gbinfomessages/Mover.java | 533 |
Vehicle toUpdate = (Vehicle)obj;
if (toUpdate.Visible) {
toUpdate.Visible = false;
return new IWorldObjectUpdateResult.WorldObjectUpdateResult(cz.cuni.amis.pogamut.base.communication.translator.event.IWorldObjectUpdateResult.Result.UPDATED, toUpdate);
} else {
return new IWorldObjectUpdateResult.WorldObjectUpdateResult(cz.cuni.amis.pogamut.base.communication.translator.event.IWorldObjectUpdateResult.Result.SAME, toUpdate);
}
}
public IWorldObject getObject() {
return orig;
}
public String toString() {
return "ObjectDisappeared[" + orig.getClass().getSimpleName() + " " + orig.getId().getStringId() + "]";
}
}
/**
* Used to create event that drops the Visible flag of the item.
*/
public Vehicle(Vehicle Original, boolean Visible) { |
File | Line |
---|
cz/cuni/amis/pogamut/udk/communication/messages/gbinfomessages/BotKilled.java | 134 |
cz/cuni/amis/pogamut/udk/communication/messages/gbinfomessages/PlayerKilled.java | 185 |
}
/**
A string describing what kind of damage killed the victim.
*/
protected
String DamageType =
null;
/**
A string describing what kind of damage killed the victim.
*/
public
String getDamageType() {
return
DamageType;
}
/**
String describing this type of death.
*/
protected
String DeathString =
null;
/**
String describing this type of death.
*/
public
String getDeathString() {
return
DeathString;
}
/**
Name of the weapon that caused this damage.
*/
protected
String WeaponName =
null;
/**
Name of the weapon that caused this damage.
*/
public
String getWeaponName() {
return
WeaponName;
}
/**
If this damage is causing our bot to burn. TODO
*/
protected
boolean Flaming =
false;
/**
If this damage is causing our bot to burn. TODO
*/
public
boolean isFlaming() {
return
Flaming;
}
/**
If this damage was caused by world - falling into lava, or falling down.
*/
protected
boolean CausedByWorld =
false;
/**
If this damage was caused by world - falling into lava, or falling down.
*/
public
boolean isCausedByWorld() {
return
CausedByWorld;
}
/**
If the damage is direct. TODO
*/
protected
boolean DirectDamage =
false;
/**
If the damage is direct. TODO
*/
public
boolean isDirectDamage() {
return
DirectDamage;
}
/**
If this damage was caused by bullet.
*/
protected
boolean BulletHit =
false;
/**
If this damage was caused by bullet.
*/
public
boolean isBulletHit() {
return
BulletHit;
}
/**
If this damage was caused by vehicle running over us.
*/
protected
boolean VehicleHit =
false;
/**
If this damage was caused by vehicle running over us.
*/
public
boolean isVehicleHit() {
return
VehicleHit;
}
/////// Properties END
/////// Extra Java code BEGIN
/////// Additional code from xslt BEGIN
public long getSimTime() {
// NOT IMPLEMENTED FOR UDK
return 0;
}
/////// Additional code from xslt END
/////// Extra Java from XML BEGIN
/////// Extra Java from XML END
/////// Extra Java code END
/**
* Cloning constructor.
*/
public PlayerKilled(PlayerKilled original) { |
File | Line |
---|
cz/cuni/amis/pogamut/udk/communication/messages/gbinfomessages/AutoTraceRay.java | 519 |
cz/cuni/amis/pogamut/udk/communication/messages/gbinfomessages/Mover.java | 609 |
updated = true;
}
o.Time = Time;
if (updated) {
return new IWorldObjectUpdateResult.WorldObjectUpdateResult(cz.cuni.amis.pogamut.base.communication.translator.event.IWorldObjectUpdateResult.Result.UPDATED, o);
} else {
return new IWorldObjectUpdateResult.WorldObjectUpdateResult(cz.cuni.amis.pogamut.base.communication.translator.event.IWorldObjectUpdateResult.Result.SAME, o);
}
}
/**
* 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).
*/
public IWorldObject getObject() {
if (orig == null) return this;
return orig;
}
public String toString() {
return
super.toString() + " | " +
"Id = " +
String.valueOf(Id) + " | " + |
File | Line |
---|
cz/cuni/amis/pogamut/udk/communication/messages/gbinfomessages/AutoTraceRay.java | 522 |
cz/cuni/amis/pogamut/udk/communication/messages/gbinfomessages/MyInventory.java | 332 |
o.Time = Time;
if (updated) {
return new IWorldObjectUpdateResult.WorldObjectUpdateResult(cz.cuni.amis.pogamut.base.communication.translator.event.IWorldObjectUpdateResult.Result.UPDATED, o);
} else {
return new IWorldObjectUpdateResult.WorldObjectUpdateResult(cz.cuni.amis.pogamut.base.communication.translator.event.IWorldObjectUpdateResult.Result.SAME, o);
}
}
/**
* 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).
*/
public IWorldObject getObject() {
if (orig == null) return this;
return orig;
}
public String toString() {
return
super.toString() + " | " +
"Id = " +
String.valueOf(Id) + " | " + |
File | Line |
---|
cz/cuni/amis/pogamut/udk/communication/translator/bot/state/MutatorListState.java | 27 |
cz/cuni/amis/pogamut/udk/communication/translator/observer/state/MutatorListState.java | 27 |
public class MutatorListState extends ObserverListState<Mutator, TranslatorContext>{
public MutatorListState() {
super(MutatorListStart.class, Mutator.class, MutatorListEnd.class);
}
@Override
public void stateEntering(TranslatorContext context, IFSMState<InfoMessage, TranslatorContext> fromState, InfoMessage symbol) {
super.restart(context);
super.stateEntering(context, fromState, symbol);
}
@Override
public void stateLeaving(TranslatorContext context, IFSMState<InfoMessage, TranslatorContext> toState, InfoMessage symbol) {
super.stateLeaving(context, toState, symbol);
context.getEventQueue().pushEvent(new MutatorListObtained(getList()));
newList();
}
@Override |
File | Line |
---|
cz/cuni/amis/pogamut/udk/communication/translator/observer/state/ReadyState.java | 36 |
cz/cuni/amis/pogamut/udk/communication/translator/server/state/ReadyState.java | 36 |
public class ReadyState extends AbstractServerFSMState<InfoMessage, TranslatorContext> {
@Override
public void init(TranslatorContext context) {
}
@Override
public void restart(TranslatorContext context) {
}
@Override
public void stateEntering(TranslatorContext context,
IFSMState<InfoMessage, TranslatorContext> fromState,
InfoMessage symbol) {
}
@Override
public void stateLeaving(TranslatorContext context,
IFSMState<InfoMessage, TranslatorContext> toState, InfoMessage symbol) {
}
@Override
protected void innerStateSymbol(TranslatorContext context, InfoMessage symbol) {
if (symbol instanceof HandShakeStart) return;
throw new UnexpectedMessageException(TranslatorMessages.unexpectedMessage(this, symbol), context.getLogger(), this);
}
} |
File | Line |
---|
cz/cuni/amis/pogamut/udk/communication/translator/observer/support/AbstractObserverFSMState.java | 17 |
cz/cuni/amis/pogamut/udk/communication/translator/server/support/AbstractServerFSMState.java | 17 |
public abstract class AbstractServerFSMState<SYMBOL, CONTEXT extends TranslatorContext> implements IFSMState<SYMBOL, CONTEXT> {
protected abstract void innerStateSymbol(CONTEXT context, SYMBOL symbol);
@Override
public final void stateSymbol(CONTEXT context, SYMBOL symbol) {
if (symbol instanceof AliveMessage) {
if (!(symbol instanceof IWorldChangeEvent)) throw new UnexpectedMessageException(TranslatorMessages.messageNotWorldEvent(this, symbol), this);
context.getEventQueue().pushEvent((IWorldChangeEvent) symbol);
} else {
innerStateSymbol(context, symbol);
}
}
@Override
public String toString() {
return getClass().getSimpleName();
}
} |
File | Line |
---|
cz/cuni/amis/pogamut/udk/communication/messages/gbinfomessages/ItemCategory.java | 2640 |
cz/cuni/amis/pogamut/udk/communication/messages/gbinfomessages/MyInventory.java | 327 |
MyInventory o = (MyInventory)obj;
boolean updated = false;
o.Time = Time;
if (updated) {
return new IWorldObjectUpdateResult.WorldObjectUpdateResult(cz.cuni.amis.pogamut.base.communication.translator.event.IWorldObjectUpdateResult.Result.UPDATED, o);
} else {
return new IWorldObjectUpdateResult.WorldObjectUpdateResult(cz.cuni.amis.pogamut.base.communication.translator.event.IWorldObjectUpdateResult.Result.SAME, o);
}
}
/**
* 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).
*/
public IWorldObject getObject() {
if (orig == null) return this;
return orig;
}
public String toString() {
return
super.toString() + " | " + |
File | Line |
---|
cz/cuni/amis/pogamut/udk/communication/messages/gbinfomessages/AutoTraceRay.java | 525 |
cz/cuni/amis/pogamut/udk/communication/messages/gbinfomessages/IncomingProjectile.java | 411 |
if (updated) {
return new IWorldObjectUpdateResult.WorldObjectUpdateResult(cz.cuni.amis.pogamut.base.communication.translator.event.IWorldObjectUpdateResult.Result.UPDATED, o);
} else {
return new IWorldObjectUpdateResult.WorldObjectUpdateResult(cz.cuni.amis.pogamut.base.communication.translator.event.IWorldObjectUpdateResult.Result.SAME, o);
}
}
/**
* 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).
*/
public IWorldObject getObject() {
if (orig == null) return this;
return orig;
}
public String toString() {
return
super.toString() + " | " +
"Id = " +
String.valueOf(Id) + " | " + |
File | Line |
---|
cz/cuni/amis/pogamut/udk/communication/translator/bot/support/BotMessageExpectedState.java | 26 |
cz/cuni/amis/pogamut/udk/communication/translator/server/support/ServerMessageExpectedState.java | 26 |
public ObserverMessageExpectedState(Class expectedMessage) {
message = expectedMessage;
}
@Override
public void init(CONTEXT context) {
}
@Override
public void restart(CONTEXT context) {
}
@Override
public void stateEntering(CONTEXT context,
IFSMState<InfoMessage, CONTEXT> fromState, InfoMessage symbol) {
}
@Override
public void stateLeaving(CONTEXT context, IFSMState<InfoMessage, CONTEXT> toState, InfoMessage symbol) {
if (!symbol.getClass().equals(message)) throw new UnexpectedMessageException(TranslatorMessages.unexpectedMessage(this, symbol), context.getLogger(), this);
}
@Override |
File | Line |
---|
cz/cuni/amis/pogamut/udk/communication/messages/gbinfomessages/AutoTraceRay.java | 519 |
cz/cuni/amis/pogamut/udk/communication/messages/gbinfomessages/GameInfo.java | 544 |
updated = true;
}
o.Time = Time;
if (updated) {
return new IWorldObjectUpdateResult.WorldObjectUpdateResult(cz.cuni.amis.pogamut.base.communication.translator.event.IWorldObjectUpdateResult.Result.UPDATED, o);
} else {
return new IWorldObjectUpdateResult.WorldObjectUpdateResult(cz.cuni.amis.pogamut.base.communication.translator.event.IWorldObjectUpdateResult.Result.SAME, o);
}
}
/**
* 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).
*/
public IWorldObject getObject() {
if (orig == null) return this;
return orig;
}
public String toString() {
return
super.toString() + " | " + |
File | Line |
---|
cz/cuni/amis/pogamut/udk/communication/translator/server/state/CommunicationTerminatedState.java | 14 |
cz/cuni/amis/pogamut/udk/communication/translator/server/state/GameInfoExpectedState.java | 27 |
public class GameInfoExpectedState extends AbstractServerFSMState<InfoMessage, TranslatorContext> {
@Override
public void init(TranslatorContext context) {
}
@Override
public void restart(TranslatorContext context) {
}
@Override
public void stateEntering(TranslatorContext context,
IFSMState<InfoMessage, TranslatorContext> fromState,
InfoMessage symbol) {
}
@Override
public void stateLeaving(TranslatorContext context,
IFSMState<InfoMessage, TranslatorContext> toState, InfoMessage symbol) {
}
@Override
protected void innerStateSymbol(TranslatorContext context, InfoMessage symbol) {
throw new UnexpectedMessageException(TranslatorMessages.unexpectedMessage(this, symbol), context.getLogger(), this);
}
} |
File | Line |
---|
cz/cuni/amis/pogamut/udk/communication/translator/bot/state/ReadyState.java | 34 |
cz/cuni/amis/pogamut/udk/communication/translator/observer/state/CommunicationTerminatedState.java | 14 |
public class GameInfoExpectedState extends AbstractObserverFSMState<InfoMessage, TranslatorContext> {
@Override
public void init(TranslatorContext context) {
}
@Override
public void restart(TranslatorContext context) {
}
@Override
public void stateEntering(TranslatorContext context,
IFSMState<InfoMessage, TranslatorContext> fromState,
InfoMessage symbol) {
}
@Override
public void stateLeaving(TranslatorContext context,
IFSMState<InfoMessage, TranslatorContext> toState, InfoMessage symbol) {
}
@Override
protected void innerStateSymbol(TranslatorContext context, InfoMessage symbol) {
throw new UnexpectedMessageException(TranslatorMessages.unexpectedMessage(this, symbol), context.getLogger(), this);
}
} |
File | Line |
---|
cz/cuni/amis/pogamut/udk/communication/translator/bot/state/CommunicationTerminatedState.java | 14 |
cz/cuni/amis/pogamut/udk/communication/translator/bot/state/GameInfoExpectedState.java | 27 |
public class GameInfoExpectedState extends AbstractBotFSMState<InfoMessage, TranslatorContext> {
@Override
public void init(TranslatorContext context) {
}
@Override
public void restart(TranslatorContext context) {
}
@Override
public void stateEntering(TranslatorContext context,
IFSMState<InfoMessage, TranslatorContext> fromState,
InfoMessage symbol) {
}
@Override
public void stateLeaving(TranslatorContext context,
IFSMState<InfoMessage, TranslatorContext> toState, InfoMessage symbol) {
}
@Override
public void stateSymbol(TranslatorContext context, InfoMessage symbol) {
throw new UnexpectedMessageException(TranslatorMessages.unexpectedMessage(this, symbol), context.getLogger(), this);
}
} |
File | Line |
---|
cz/cuni/amis/pogamut/udk/communication/messages/gbinfomessages/ConfigChange.java | 441 |
cz/cuni/amis/pogamut/udk/communication/messages/gbinfomessages/Self.java | 620 |
}
/**
Name of the current BDI action.
*/
protected
String Action =
null;
/**
Name of the current BDI action.
*/
public
String getAction() {
return
Action;
}
/////// Properties END
/////// Extra Java code BEGIN
/////// Additional code from xslt BEGIN
protected double Time = 0;
protected double getTime() {
return Time;
}
protected void setTime(double time) {
this.Time = time;
}
public double getLastSeenTime() {
return Time;
}
public ILocalWorldObject getLocal() {
return null;
}
public ISharedWorldObject getShared() {
return null;
}
public IStaticWorldObject getStatic() {
return null;
}
@Override
public long getSimTime() {
return (long)getLastSeenTime();
}
public boolean equals(Object obj) {
if (!(obj instanceof Self)) return false; |
File | Line |
---|
cz/cuni/amis/pogamut/udk/communication/translator/bot/state/ReadyState.java | 34 |
cz/cuni/amis/pogamut/udk/communication/translator/server/state/GameInfoExpectedState.java | 27 |
public class CommunicationTerminatedState extends AbstractServerFSMState<InfoMessage, TranslatorContext>{
@Override
public void init(TranslatorContext context) {
}
@Override
public void restart(TranslatorContext context) {
}
@Override
public void stateEntering(TranslatorContext context,
IFSMState<InfoMessage, TranslatorContext> fromState,
InfoMessage symbol) {
}
@Override
public void stateLeaving(TranslatorContext context,
IFSMState<InfoMessage, TranslatorContext> toState, InfoMessage symbol) {
}
@Override
protected void innerStateSymbol(TranslatorContext context, InfoMessage symbol) {
throw new UnexpectedMessageException(TranslatorMessages.unexpectedMessage(this, symbol), context.getLogger(), this);
}
} |
File | Line |
---|
cz/cuni/amis/pogamut/udk/communication/messages/gbinfomessages/ConfigChange.java | 656 |
cz/cuni/amis/pogamut/udk/communication/messages/gbinfomessages/ItemCategory.java | 2645 |
o.Time = Time;
if (updated) {
return new IWorldObjectUpdateResult.WorldObjectUpdateResult(cz.cuni.amis.pogamut.base.communication.translator.event.IWorldObjectUpdateResult.Result.UPDATED, o);
} else {
return new IWorldObjectUpdateResult.WorldObjectUpdateResult(cz.cuni.amis.pogamut.base.communication.translator.event.IWorldObjectUpdateResult.Result.SAME, o);
}
}
/**
* 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).
*/
public IWorldObject getObject() {
if (orig == null) return this;
return orig;
}
public String toString() {
return
super.toString() + " | " + |
File | Line |
---|
cz/cuni/amis/pogamut/udk/communication/messages/gbinfomessages/BotKilled.java | 369 |
cz/cuni/amis/pogamut/udk/communication/messages/gbinfomessages/PlayerKilled.java | 430 |
String.valueOf(KilledPawn) + " | " +
"DamageType = " +
String.valueOf(DamageType) + " | " +
"DeathString = " +
String.valueOf(DeathString) + " | " +
"WeaponName = " +
String.valueOf(WeaponName) + " | " +
"Flaming = " +
String.valueOf(Flaming) + " | " +
"CausedByWorld = " +
String.valueOf(CausedByWorld) + " | " +
"DirectDamage = " +
String.valueOf(DirectDamage) + " | " +
"BulletHit = " +
String.valueOf(BulletHit) + " | " +
"VehicleHit = " +
String.valueOf(VehicleHit) + " | " +
"";
}
public String toHtmlString() {
return super.toString() + |
File | Line |
---|
cz/cuni/amis/pogamut/udk/communication/messages/gbinfomessages/AutoTraceRay.java | 522 |
cz/cuni/amis/pogamut/udk/communication/messages/gbinfomessages/ItemCategory.java | 2645 |
o.Time = Time;
if (updated) {
return new IWorldObjectUpdateResult.WorldObjectUpdateResult(cz.cuni.amis.pogamut.base.communication.translator.event.IWorldObjectUpdateResult.Result.UPDATED, o);
} else {
return new IWorldObjectUpdateResult.WorldObjectUpdateResult(cz.cuni.amis.pogamut.base.communication.translator.event.IWorldObjectUpdateResult.Result.SAME, o);
}
}
/**
* 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).
*/
public IWorldObject getObject() {
if (orig == null) return this;
return orig;
}
public String toString() {
return
super.toString() + " | " + |
File | Line |
---|
cz/cuni/amis/pogamut/udk/agent/navigation/loquenavigator/LoqueNavigator.java | 635 |
cz/cuni/amis/pogamut/udk/agent/navigation/martinnavigator/MartinNavigator.java | 485 |
if (log != null && log.isLoggable(Level.FINEST)) log.finest ("LoqueNavigator.navigToCurrentNode(): traveling to current node, distance = " + localDistance);
// are we close enough to think about the next node?
// if ( (localDistance < 600) || (localDistance2 < 600) )
// {
// prepare the next node only when it is not already prepared..
if ((navigCurrentNode != null && navigCurrentNode == navigNextNode) || navigCurrentLocation.equals(navigNextLocation))
{
// prepare next node in the path
prepareNextNode();
}
// }
int testDistance = 200; // default constant suitable for default running
if (navigCurrentNode != null && (navigCurrentNode.isLiftCenter() || navigCurrentNode.isLiftExit())) {
// if we should get to lift exit or the lift center, we must use more accurate constants
testDistance = 150;
}
// are we close enough to switch to the next node?
if ( (localDistance < testDistance) || (localDistance2 < testDistance) )
{
// switch navigation to the next node
if (!switchToNextNode ())
{
// switch to the direct navigation
if (log != null && log.isLoggable(Level.FINE)) log.fine ("Navigator.navigToCurrentNode(): switch to direct navigation");
return initDirectly(navigDestination);
}
} else { |
File | Line |
---|
cz/cuni/amis/pogamut/udk/communication/messages/gbinfomessages/HearNoise.java | 197 |
cz/cuni/amis/pogamut/udk/communication/messages/gbinfomessages/HearPickup.java | 180 |
public HearPickup() {
}
public String toString() {
return
super.toString() + " | " +
"Source = " +
String.valueOf(Source) + " | " +
"Type = " +
String.valueOf(Type) + " | " +
"Rotation = " +
String.valueOf(Rotation) + " | " +
"";
}
public String toHtmlString() {
return super.toString() +
"<b>Source</b> : " +
String.valueOf(Source) +
" <br/> " +
"<b>Type</b> : " +
String.valueOf(Type) +
" <br/> " +
"<b>Rotation</b> : " +
String.valueOf(Rotation) +
" <br/> " +
"";
}
} |
File | Line |
---|
cz/cuni/amis/pogamut/udk/communication/messages/gbinfomessages/GlobalChat.java | 190 |
cz/cuni/amis/pogamut/udk/communication/messages/gbinfomessages/TeamChat.java | 190 |
public TeamChat() {
}
public String toString() {
return
super.toString() + " | " +
"Id = " +
String.valueOf(Id) + " | " +
"Name = " +
String.valueOf(Name) + " | " +
"Text = " +
String.valueOf(Text) + " | " +
"";
}
public String toHtmlString() {
return super.toString() +
"<b>Id</b> : " +
String.valueOf(Id) +
" <br/> " +
"<b>Name</b> : " +
String.valueOf(Name) +
" <br/> " +
"<b>Text</b> : " +
String.valueOf(Text) +
" <br/> " +
"";
}
} |
File | Line |
---|
cz/cuni/amis/pogamut/udk/communication/messages/gbinfomessages/EnteredVehicle.java | 175 |
cz/cuni/amis/pogamut/udk/communication/messages/gbinfomessages/LockedVehicle.java | 173 |
public LockedVehicle() {
}
public String toString() {
return
super.toString() + " | " +
"Id = " +
String.valueOf(Id) + " | " +
"Type = " +
String.valueOf(Type) + " | " +
"Location = " +
String.valueOf(Location) + " | " +
"";
}
public String toHtmlString() {
return super.toString() +
"<b>Id</b> : " +
String.valueOf(Id) +
" <br/> " +
"<b>Type</b> : " +
String.valueOf(Type) +
" <br/> " +
"<b>Location</b> : " +
String.valueOf(Location) +
" <br/> " +
"";
}
} |
File | Line |
---|
cz/cuni/amis/pogamut/udk/communication/messages/gbcommands/Configuration.java | 709 |
cz/cuni/amis/pogamut/udk/communication/messages/gbinfomessages/ConfigChange.java | 750 |
String.valueOf(Name) +
" <br/> " +
"<b>SpeedMultiplier</b> : " +
String.valueOf(SpeedMultiplier) +
" <br/> " +
"<b>RotationRate</b> : " +
String.valueOf(RotationRate) +
" <br/> " +
"<b>Invulnerable</b> : " +
String.valueOf(Invulnerable) +
" <br/> " +
"<b>VisionTime</b> : " +
String.valueOf(VisionTime) +
" <br/> " +
"<b>ShowDebug</b> : " +
String.valueOf(ShowDebug) +
" <br/> " +
"<b>ShowFocalPoint</b> : " +
String.valueOf(ShowFocalPoint) +
" <br/> " +
"<b>DrawTraceLines</b> : " +
String.valueOf(DrawTraceLines) +
" <br/> " +
"<b>SynchronousOff</b> : " +
String.valueOf(SynchronousOff) +
" <br/> " +
"<b>AutoPickupOff</b> : " +
String.valueOf(AutoPickupOff) +
" <br/> " + |
File | Line |
---|
cz/cuni/amis/pogamut/udk/bot/command/AdvancedLocomotion.java | 122 |
cz/cuni/amis/pogamut/udk/bot/command/AdvancedLocomotion.java | 150 |
public void strafeRight(double distance) {
if (self == null) {
self = agent.getWorldView().getSingle(Self.class);
}
if (self != null) {
Location startLoc = self.getLocation();
Location directionVector = self.getRotation().toLocation();
Location targetVec = directionVector.cross(new Location(0, 0, 1))
.getNormalized().scale(-distance);
agent.getAct().act(
new Move().setFirstLocation(startLoc.add(targetVec))
.setFocusLocation( |
File | Line |
---|
cz/cuni/amis/pogamut/udk/agent/navigation/loquenavigator/LoqueNavigator.java | 709 |
cz/cuni/amis/pogamut/udk/agent/navigation/loquenavigator/LoqueNavigator.java | 741 |
if ( ( (Math.abs(vDistance) > 50) || (hDistance > 400) ) ) {
// run to the last node, the one we're waiting on
if (!runner.runToLocation(navigLastLocation.getLocation(), null, navigCurrentLocation.getLocation(), navigCurrentLink, (navigLastNode == null ? true : isReachable(navigLastNode))))
{
if (log != null && log.isLoggable(Level.FINE)) log.fine ("LoqueNavigator.navigThroughMover("+stage+"): navigation to last node failed");
return Stage.CRASHED;
}
// and keep waiting for the mover to go to the correct position
if (log != null && log.isLoggable(Level.FINER))
log.finer (
"LoqueNavigator.navigThroughMover("+stage+"): riding the mover" |
File | Line |
---|
cz/cuni/amis/pogamut/udk/communication/translator/observer/state/MapListState.java | 29 |
cz/cuni/amis/pogamut/udk/communication/translator/server/state/MapListState.java | 28 |
public class MapListState extends ServerListState<MapList, TranslatorContext> {
public MapListState() {
super(MapListStart.class, MapList.class, MapListEnd.class);
}
@Override
public void stateLeaving(TranslatorContext context,
IFSMState<InfoMessage, TranslatorContext> toState, InfoMessage symbol) {
super.stateLeaving(context, toState, symbol);
context.getEventQueue().pushEvent(new MapListObtained(getList()));
newList();
}
@Override
protected void innerStateSymbol(TranslatorContext context,
InfoMessage symbol) {
super.innerStateSymbol(context, symbol);
if (symbol instanceof MapList) { |
File | Line |
---|
cz/cuni/amis/pogamut/udk/communication/messages/gbinfomessages/AliveMessage.java | 204 |
cz/cuni/amis/pogamut/udk/communication/messages/gbinfomessages/Player.java | 636 |
if (updated) {
return new IWorldObjectUpdateResult.WorldObjectUpdateResult(cz.cuni.amis.pogamut.base.communication.translator.event.IWorldObjectUpdateResult.Result.UPDATED, o);
} else {
return new IWorldObjectUpdateResult.WorldObjectUpdateResult(cz.cuni.amis.pogamut.base.communication.translator.event.IWorldObjectUpdateResult.Result.SAME, o);
}
}
/**
* 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).
*/
public IWorldObject getObject() {
if (orig == null) return this;
return orig;
}
public String toString() {
return
super.toString() + " | " + |
File | Line |
---|
cz/cuni/amis/pogamut/udk/bot/command/AdvancedLocomotion.java | 209 |
cz/cuni/amis/pogamut/udk/bot/command/AdvancedLocomotion.java | 237 |
public void strafeLeft(double distance) {
if (self == null) {
self = agent.getWorldView().getSingle(Self.class);
}
if (self != null) {
Location startLoc = self.getLocation();
Location directionVector = self.getRotation().toLocation();
Location targetVec = directionVector.cross(new Location(0, 0, 1))
.getNormalized().scale(distance);
agent.getAct().act(
new Move().setFirstLocation(startLoc.add(targetVec))
.setFocusLocation( |
File | Line |
---|
cz/cuni/amis/pogamut/udk/factory/guice/remoteagent/UDKObserverModule.java | 58 |
cz/cuni/amis/pogamut/udk/factory/guice/remoteagent/UDKServerModule.java | 61 |
public class UDKServerModule<PARAMS extends UDKAgentParameters> extends UDKCommunicationModule<PARAMS> {
/**
* Dependency provider for the world view, so the world view know when to start.
*/
protected AdaptableProvider<ComponentDependencies> worldViewDependenciesProvider = new AdaptableProvider<ComponentDependencies>(null);
@Override
public void prepareNewAgent(PARAMS agentParameters) {
super.prepareNewAgent(agentParameters);
worldViewDependenciesProvider.set(new ComponentDependencies(ComponentDependencyType.STARTS_WITH).add(agentParameters.getAgentId()));
}
@Override
protected void configureModules() {
super.configureModules();
addModule(new AbstractModule() {
@Override
public void configure() {
bind(IWorldMessageTranslator.class).to(ServerFSM.class); |
File | Line |
---|
cz/cuni/amis/pogamut/udk/communication/messages/gbcommands/CheckReachability.java | 214 |
cz/cuni/amis/pogamut/udk/communication/messages/gbcommands/GetPath.java | 191 |
public GetPath(GetPath original) {
this.Id=original.Id;
this.Target=original.Target;
this.Location=original.Location;
}
public String toString() {
return
toMessage();
}
public String toHtmlString() {
return super.toString() +
"<b>Id</b> : " +
String.valueOf(Id) +
" <br/> " +
"<b>Target</b> : " +
String.valueOf(Target) +
" <br/> " +
"<b>Location</b> : " +
String.valueOf(Location) +
" <br/> " +
"";
}
public String toMessage() {
StringBuffer buf = new StringBuffer();
buf.append("GETPATH"); |
File | Line |
---|
cz/cuni/amis/pogamut/udk/bot/command/AdvancedLocomotion.java | 94 |
cz/cuni/amis/pogamut/udk/bot/command/AdvancedLocomotion.java | 150 |
public void strafeRight(double distance, ILocated focusLocation) {
if (self == null) {
self = agent.getWorldView().getSingle(Self.class);
}
if (self != null) {
Location startLoc = self.getLocation();
Location directionVector = self.getRotation().toLocation();
Location targetVec = directionVector.cross(new Location(0, 0, 1))
.getNormalized().scale(-distance);
agent.getAct().act(
new Move().setFirstLocation(startLoc.add(targetVec))
.setFocusLocation(focusLocation.getLocation())); |
File | Line |
---|
cz/cuni/amis/pogamut/udk/bot/command/AdvancedLocomotion.java | 181 |
cz/cuni/amis/pogamut/udk/bot/command/AdvancedLocomotion.java | 209 |
public void strafeLeft(double distance, ILocated focusLocation) {
if (self == null) {
self = agent.getWorldView().getSingle(Self.class);
}
if (self != null) {
Location startLoc = self.getLocation();
Location directionVector = self.getRotation().toLocation();
Location targetVec = directionVector.cross(new Location(0, 0, 1))
.getNormalized().scale(distance);
agent.getAct().act(
new Move().setFirstLocation(startLoc.add(targetVec))
.setFocusLocation(focusLocation.getLocation())); |