本文整理汇总了Java中rescuecore2.standard.entities.Human.getDamage方法的典型用法代码示例。如果您正苦于以下问题:Java Human.getDamage方法的具体用法?Java Human.getDamage怎么用?Java Human.getDamage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类rescuecore2.standard.entities.Human
的用法示例。
在下文中一共展示了Human.getDamage方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isValidHuman
import rescuecore2.standard.entities.Human; //导入方法依赖的package包/类
private boolean isValidHuman(StandardEntity entity) {
if (entity == null)
return false;
if (!(entity instanceof Human))
return false;
Human target = (Human) entity;
if (!target.isHPDefined() || target.getHP() == 0)
return false;
if (!target.isPositionDefined())
return false;
if (!target.isDamageDefined() || target.getDamage() == 0)
return false;
if (!target.isBuriednessDefined())
return false;
StandardEntity position = worldInfo.getPosition(target);
if (position == null)
return false;
StandardEntityURN positionURN = position.getStandardURN();
if (positionURN == REFUGE || positionURN == AMBULANCE_TEAM)
return false;
return true;
}
示例2: MessageHuman
import rescuecore2.standard.entities.Human; //导入方法依赖的package包/类
public MessageHuman(int messageID, Human human)
{
super(messageID);
humanID = human.getID();
humanHP = human.getHP();
humanBuriedness = human.getBuriedness();
humanDamage = human.getDamage();
humanPosition = human.getPosition();
}
示例3: isCommandCompleted
import rescuecore2.standard.entities.Human; //导入方法依赖的package包/类
private boolean isCommandCompleted() {
Human agent = (Human) this.agentInfo.me();
switch (this.type) {
case ACTION_REST:
if(this.target == null) {
return (agent.getDamage() == 0);
}
if (Objects.requireNonNull(this.worldInfo.getEntity(this.target)).getStandardURN() == REFUGE) {
if (agent.getPosition().getValue() == this.target.getValue()) {
return (agent.getDamage() == 0);
}
}
return false;
case ACTION_MOVE:
return this.target == null || this.agentInfo.getPosition().getValue() == this.target.getValue();
case ACTION_RESCUE:
if(this.target == null) {
return true;
}
Human human = (Human) Objects.requireNonNull(this.worldInfo.getEntity(this.target));
return human.isBuriednessDefined() && human.getBuriedness() == 0 || (human.isHPDefined() && human.getHP() == 0);
case ACTION_LOAD:
if(this.target == null) {
return true;
}
Human human1 = (Human) Objects.requireNonNull(this.worldInfo.getEntity(this.target));
if((human1.isHPDefined() && human1.getHP() == 0)) {
return true;
}
if(human1.getStandardURN() != CIVILIAN) {
this.type = ACTION_RESCUE;
return this.isCommandCompleted();
}
if (human1.isPositionDefined()) {
EntityID position = human1.getPosition();
if (this.worldInfo.getEntityIDsOfType(AMBULANCE_TEAM).contains(position)) {
return true;
} else if (this.worldInfo.getEntity(position).getStandardURN() == REFUGE) {
return true;
}
}
return false;
case ACTION_UNLOAD:
if(this.target != null) {
StandardEntity entity = this.worldInfo.getEntity(this.target);
if (entity != null && entity instanceof Area) {
if (this.target.getValue() != this.agentInfo.getPosition().getValue()) {
return false;
}
}
}
return (this.agentInfo.someoneOnBoard() == null);
case ACTION_AUTONOMY:
if(this.target != null) {
StandardEntity targetEntity = this.worldInfo.getEntity(this.target);
if (targetEntity instanceof Area) {
this.type = this.agentInfo.someoneOnBoard() == null ? ACTION_MOVE : ACTION_UNLOAD;
return this.isCommandCompleted();
}else if (targetEntity instanceof Human) {
Human h = (Human) targetEntity;
if((h.isHPDefined() && h.getHP() == 0)) {
return true;
}
this.type = h.getStandardURN() == CIVILIAN ? ACTION_LOAD : ACTION_RESCUE;
return this.isCommandCompleted();
}
}
return true;
}
return true;
}