sarl-fireworks/src/main/generated-sources/sarl/io/sarl/demos/fireworks/Rocket.java

512 lines
27 KiB
Java

package io.sarl.demos.fireworks;
import io.sarl.core.AgentTask;
import io.sarl.core.Behaviors;
import io.sarl.core.DefaultContextInteractions;
import io.sarl.core.ExternalContextAccess;
import io.sarl.core.Initialize;
import io.sarl.core.InnerContextAccess;
import io.sarl.core.Lifecycle;
import io.sarl.core.Logging;
import io.sarl.core.MemberJoined;
import io.sarl.core.MemberLeft;
import io.sarl.core.Schedules;
import io.sarl.demos.fireworks.Exit;
import io.sarl.demos.fireworks.Explode;
import io.sarl.demos.fireworks.Fire;
import io.sarl.demos.fireworks.FireReady;
import io.sarl.demos.fireworks.Freeze;
import io.sarl.demos.fireworks.Positions;
import io.sarl.demos.fireworks.UpdateRocketPosition;
import io.sarl.lang.annotation.ImportedCapacityFeature;
import io.sarl.lang.annotation.PerceptGuardEvaluator;
import io.sarl.lang.annotation.SarlSpecification;
import io.sarl.lang.annotation.SyntheticMember;
import io.sarl.lang.core.Agent;
import io.sarl.lang.core.BuiltinCapacitiesProvider;
import io.sarl.lang.core.Skill;
import io.sarl.lang.util.ClearableReference;
import java.util.Collection;
import java.util.List;
import java.util.Random;
import java.util.UUID;
import java.util.Vector;
import javax.inject.Inject;
import org.eclipse.xtext.xbase.lib.Conversions;
import org.eclipse.xtext.xbase.lib.DoubleExtensions;
import org.eclipse.xtext.xbase.lib.Exceptions;
import org.eclipse.xtext.xbase.lib.Extension;
import org.eclipse.xtext.xbase.lib.Inline;
import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
import org.eclipse.xtext.xbase.lib.Pure;
@SarlSpecification("0.5")
@SuppressWarnings("all")
public class Rocket extends Agent {
private Double x;
private Double y;
private Double gravity;
private Double speedx;
private Double speedy;
private Integer fireQuantity;
private Integer lifetime;
private boolean frozen = false;
private boolean exploded = false;
private boolean exited = false;
private Positions grid;
private UUID id;
private AgentTask move;
@SyntheticMember
private void $behaviorUnit$Exit$0(final Exit occurrence) {
DefaultContextInteractions _$CAPACITY_USE$IO_SARL_CORE_DEFAULTCONTEXTINTERACTIONS$CALLER = this.$castSkill(DefaultContextInteractions.class, (this.$CAPACITY_USE$IO_SARL_CORE_DEFAULTCONTEXTINTERACTIONS == null || this.$CAPACITY_USE$IO_SARL_CORE_DEFAULTCONTEXTINTERACTIONS.get() == null) ? (this.$CAPACITY_USE$IO_SARL_CORE_DEFAULTCONTEXTINTERACTIONS = $getSkill(DefaultContextInteractions.class)) : this.$CAPACITY_USE$IO_SARL_CORE_DEFAULTCONTEXTINTERACTIONS);
Exit _exit = new Exit();
_$CAPACITY_USE$IO_SARL_CORE_DEFAULTCONTEXTINTERACTIONS$CALLER.emit(_exit);
Lifecycle _$CAPACITY_USE$IO_SARL_CORE_LIFECYCLE$CALLER = this.$castSkill(Lifecycle.class, (this.$CAPACITY_USE$IO_SARL_CORE_LIFECYCLE == null || this.$CAPACITY_USE$IO_SARL_CORE_LIFECYCLE.get() == null) ? (this.$CAPACITY_USE$IO_SARL_CORE_LIFECYCLE = $getSkill(Lifecycle.class)) : this.$CAPACITY_USE$IO_SARL_CORE_LIFECYCLE);
_$CAPACITY_USE$IO_SARL_CORE_LIFECYCLE$CALLER.killMe();
}
@SyntheticMember
@Pure
private boolean $behaviorUnitGuard$Exit$0(final Exit it, final Exit occurrence) {
InnerContextAccess _$CAPACITY_USE$IO_SARL_CORE_INNERCONTEXTACCESS$CALLER = this.$castSkill(InnerContextAccess.class, (this.$CAPACITY_USE$IO_SARL_CORE_INNERCONTEXTACCESS == null || this.$CAPACITY_USE$IO_SARL_CORE_INNERCONTEXTACCESS.get() == null) ? (this.$CAPACITY_USE$IO_SARL_CORE_INNERCONTEXTACCESS = $getSkill(InnerContextAccess.class)) : this.$CAPACITY_USE$IO_SARL_CORE_INNERCONTEXTACCESS);
boolean _hasMemberAgent = _$CAPACITY_USE$IO_SARL_CORE_INNERCONTEXTACCESS$CALLER.hasMemberAgent();
boolean _not = (!_hasMemberAgent);
return _not;
}
@SyntheticMember
private void $behaviorUnit$Exit$1(final Exit occurrence) {
this.exploded = true;
this.frozen = true;
this.exited = true;
Schedules _$CAPACITY_USE$IO_SARL_CORE_SCHEDULES$CALLER = this.$castSkill(Schedules.class, (this.$CAPACITY_USE$IO_SARL_CORE_SCHEDULES == null || this.$CAPACITY_USE$IO_SARL_CORE_SCHEDULES.get() == null) ? (this.$CAPACITY_USE$IO_SARL_CORE_SCHEDULES = $getSkill(Schedules.class)) : this.$CAPACITY_USE$IO_SARL_CORE_SCHEDULES);
_$CAPACITY_USE$IO_SARL_CORE_SCHEDULES$CALLER.cancel(this.move, true);
InnerContextAccess _$CAPACITY_USE$IO_SARL_CORE_INNERCONTEXTACCESS$CALLER = this.$castSkill(InnerContextAccess.class, (this.$CAPACITY_USE$IO_SARL_CORE_INNERCONTEXTACCESS == null || this.$CAPACITY_USE$IO_SARL_CORE_INNERCONTEXTACCESS.get() == null) ? (this.$CAPACITY_USE$IO_SARL_CORE_INNERCONTEXTACCESS = $getSkill(InnerContextAccess.class)) : this.$CAPACITY_USE$IO_SARL_CORE_INNERCONTEXTACCESS);
Exit _exit = new Exit();
_$CAPACITY_USE$IO_SARL_CORE_INNERCONTEXTACCESS$CALLER.getInnerContext().getDefaultSpace().emit(_exit, null);
}
@SyntheticMember
@Pure
private boolean $behaviorUnitGuard$Exit$1(final Exit it, final Exit occurrence) {
return (this.$castSkill(InnerContextAccess.class, (this.$CAPACITY_USE$IO_SARL_CORE_INNERCONTEXTACCESS == null || this.$CAPACITY_USE$IO_SARL_CORE_INNERCONTEXTACCESS.get() == null) ? (this.$CAPACITY_USE$IO_SARL_CORE_INNERCONTEXTACCESS = $getSkill(InnerContextAccess.class)) : this.$CAPACITY_USE$IO_SARL_CORE_INNERCONTEXTACCESS).hasMemberAgent() && (!this.exited));
}
@SyntheticMember
private void $behaviorUnit$Freeze$2(final Freeze occurrence) {
this.frozen = occurrence.value;
if (this.frozen) {
Schedules _$CAPACITY_USE$IO_SARL_CORE_SCHEDULES$CALLER = this.$castSkill(Schedules.class, (this.$CAPACITY_USE$IO_SARL_CORE_SCHEDULES == null || this.$CAPACITY_USE$IO_SARL_CORE_SCHEDULES.get() == null) ? (this.$CAPACITY_USE$IO_SARL_CORE_SCHEDULES = $getSkill(Schedules.class)) : this.$CAPACITY_USE$IO_SARL_CORE_SCHEDULES);
_$CAPACITY_USE$IO_SARL_CORE_SCHEDULES$CALLER.cancel(this.move, true);
}
if ((!this.frozen)) {
Behaviors _$CAPACITY_USE$IO_SARL_CORE_BEHAVIORS$CALLER = this.$castSkill(Behaviors.class, (this.$CAPACITY_USE$IO_SARL_CORE_BEHAVIORS == null || this.$CAPACITY_USE$IO_SARL_CORE_BEHAVIORS.get() == null) ? (this.$CAPACITY_USE$IO_SARL_CORE_BEHAVIORS = $getSkill(Behaviors.class)) : this.$CAPACITY_USE$IO_SARL_CORE_BEHAVIORS);
UpdateRocketPosition _updateRocketPosition = new UpdateRocketPosition();
_$CAPACITY_USE$IO_SARL_CORE_BEHAVIORS$CALLER.wake(_updateRocketPosition);
}
}
@SyntheticMember
private void $behaviorUnit$Initialize$3(final Initialize occurrence) {
Logging _$CAPACITY_USE$IO_SARL_CORE_LOGGING$CALLER = this.$castSkill(Logging.class, (this.$CAPACITY_USE$IO_SARL_CORE_LOGGING == null || this.$CAPACITY_USE$IO_SARL_CORE_LOGGING.get() == null) ? (this.$CAPACITY_USE$IO_SARL_CORE_LOGGING = $getSkill(Logging.class)) : this.$CAPACITY_USE$IO_SARL_CORE_LOGGING);
_$CAPACITY_USE$IO_SARL_CORE_LOGGING$CALLER.info("New rocket launched");
Random rnd = new Random();
boolean _equals = Integer.valueOf(((List<Object>)Conversions.doWrapArray(occurrence.parameters)).size()).equals(Integer.valueOf(7));
if (_equals) {
Object _get = occurrence.parameters[0];
this.x = ((Double) _get);
Object _get_1 = occurrence.parameters[1];
this.y = ((Double) _get_1);
Object _get_2 = occurrence.parameters[2];
this.speedx = ((Double) _get_2);
Object _get_3 = occurrence.parameters[3];
this.speedy = ((Double) _get_3);
Object _get_4 = occurrence.parameters[4];
this.gravity = ((Double) _get_4);
Object _get_5 = occurrence.parameters[5];
this.fireQuantity = ((Integer) _get_5);
Object _get_6 = occurrence.parameters[6];
this.grid = ((Positions) _get_6);
} else {
Logging _$CAPACITY_USE$IO_SARL_CORE_LOGGING$CALLER_1 = this.$castSkill(Logging.class, (this.$CAPACITY_USE$IO_SARL_CORE_LOGGING == null || this.$CAPACITY_USE$IO_SARL_CORE_LOGGING.get() == null) ? (this.$CAPACITY_USE$IO_SARL_CORE_LOGGING = $getSkill(Logging.class)) : this.$CAPACITY_USE$IO_SARL_CORE_LOGGING);
_$CAPACITY_USE$IO_SARL_CORE_LOGGING$CALLER_1.info("Error in Fireworks Initialize : bad parameters number");
}
int _nextInt = rnd.nextInt(5);
int _multiply = (_nextInt * 300);
int _plus = (_multiply + 300);
this.lifetime = Integer.valueOf(_plus);
this.id = UUID.randomUUID();
Schedules _$CAPACITY_USE$IO_SARL_CORE_SCHEDULES$CALLER = this.$castSkill(Schedules.class, (this.$CAPACITY_USE$IO_SARL_CORE_SCHEDULES == null || this.$CAPACITY_USE$IO_SARL_CORE_SCHEDULES.get() == null) ? (this.$CAPACITY_USE$IO_SARL_CORE_SCHEDULES = $getSkill(Schedules.class)) : this.$CAPACITY_USE$IO_SARL_CORE_SCHEDULES);
final Procedure1<Agent> _function = (Agent it) -> {
try {
Behaviors _$CAPACITY_USE$IO_SARL_CORE_BEHAVIORS$CALLER = this.$castSkill(Behaviors.class, (this.$CAPACITY_USE$IO_SARL_CORE_BEHAVIORS == null || this.$CAPACITY_USE$IO_SARL_CORE_BEHAVIORS.get() == null) ? (this.$CAPACITY_USE$IO_SARL_CORE_BEHAVIORS = $getSkill(Behaviors.class)) : this.$CAPACITY_USE$IO_SARL_CORE_BEHAVIORS);
UpdateRocketPosition _updateRocketPosition = new UpdateRocketPosition();
_$CAPACITY_USE$IO_SARL_CORE_BEHAVIORS$CALLER.wake(_updateRocketPosition);
} catch (final Throwable _t) {
if (_t instanceof Exception) {
final Exception e = (Exception)_t;
e.printStackTrace();
} else {
throw Exceptions.sneakyThrow(_t);
}
}
};
this.move = _$CAPACITY_USE$IO_SARL_CORE_SCHEDULES$CALLER.atFixedDelay(30, _function);
}
@SyntheticMember
private void $behaviorUnit$UpdateRocketPosition$4(final UpdateRocketPosition occurrence) {
Vector<Double> vect = new Vector<Double>(2);
double _plus = DoubleExtensions.operator_plus(this.x, this.speedx);
this.x = Double.valueOf(_plus);
double _plus_1 = DoubleExtensions.operator_plus(this.y, this.speedy);
this.y = Double.valueOf(_plus_1);
vect.clear();
vect.add(this.x);
vect.add(this.y);
this.lifetime = Integer.valueOf(((this.lifetime).intValue() - 10));
if ((this.grid != null)) {
this.grid.setRocketPosition(this.id, vect);
}
if (((this.lifetime).intValue() <= 0)) {
this.exploded = true;
Schedules _$CAPACITY_USE$IO_SARL_CORE_SCHEDULES$CALLER = this.$castSkill(Schedules.class, (this.$CAPACITY_USE$IO_SARL_CORE_SCHEDULES == null || this.$CAPACITY_USE$IO_SARL_CORE_SCHEDULES.get() == null) ? (this.$CAPACITY_USE$IO_SARL_CORE_SCHEDULES = $getSkill(Schedules.class)) : this.$CAPACITY_USE$IO_SARL_CORE_SCHEDULES);
_$CAPACITY_USE$IO_SARL_CORE_SCHEDULES$CALLER.cancel(this.move, true);
this.grid.hideHocketPosition(this.id);
Behaviors _$CAPACITY_USE$IO_SARL_CORE_BEHAVIORS$CALLER = this.$castSkill(Behaviors.class, (this.$CAPACITY_USE$IO_SARL_CORE_BEHAVIORS == null || this.$CAPACITY_USE$IO_SARL_CORE_BEHAVIORS.get() == null) ? (this.$CAPACITY_USE$IO_SARL_CORE_BEHAVIORS = $getSkill(Behaviors.class)) : this.$CAPACITY_USE$IO_SARL_CORE_BEHAVIORS);
Explode _explode = new Explode();
_$CAPACITY_USE$IO_SARL_CORE_BEHAVIORS$CALLER.wake(_explode);
}
}
@SyntheticMember
@Pure
private boolean $behaviorUnitGuard$UpdateRocketPosition$4(final UpdateRocketPosition it, final UpdateRocketPosition occurrence) {
return ((this.isFromMe(occurrence) && (!this.frozen)) && (!this.exploded));
}
@SyntheticMember
private void $behaviorUnit$Explode$5(final Explode occurrence) {
for (int i = 0; (i < (this.fireQuantity).intValue()); i++) {
Lifecycle _$CAPACITY_USE$IO_SARL_CORE_LIFECYCLE$CALLER = this.$castSkill(Lifecycle.class, (this.$CAPACITY_USE$IO_SARL_CORE_LIFECYCLE == null || this.$CAPACITY_USE$IO_SARL_CORE_LIFECYCLE.get() == null) ? (this.$CAPACITY_USE$IO_SARL_CORE_LIFECYCLE = $getSkill(Lifecycle.class)) : this.$CAPACITY_USE$IO_SARL_CORE_LIFECYCLE);
InnerContextAccess _$CAPACITY_USE$IO_SARL_CORE_INNERCONTEXTACCESS$CALLER = this.$castSkill(InnerContextAccess.class, (this.$CAPACITY_USE$IO_SARL_CORE_INNERCONTEXTACCESS == null || this.$CAPACITY_USE$IO_SARL_CORE_INNERCONTEXTACCESS.get() == null) ? (this.$CAPACITY_USE$IO_SARL_CORE_INNERCONTEXTACCESS = $getSkill(InnerContextAccess.class)) : this.$CAPACITY_USE$IO_SARL_CORE_INNERCONTEXTACCESS);
_$CAPACITY_USE$IO_SARL_CORE_LIFECYCLE$CALLER.spawnInContext(Fire.class, _$CAPACITY_USE$IO_SARL_CORE_INNERCONTEXTACCESS$CALLER.getInnerContext(), this.x, this.y, this.grid, this.id);
}
}
@SyntheticMember
private void $behaviorUnit$MemberLeft$6(final MemberLeft occurrence) {
this.exited = true;
this.grid.removeRocketPosition(this.id);
Lifecycle _$CAPACITY_USE$IO_SARL_CORE_LIFECYCLE$CALLER = this.$castSkill(Lifecycle.class, (this.$CAPACITY_USE$IO_SARL_CORE_LIFECYCLE == null || this.$CAPACITY_USE$IO_SARL_CORE_LIFECYCLE.get() == null) ? (this.$CAPACITY_USE$IO_SARL_CORE_LIFECYCLE = $getSkill(Lifecycle.class)) : this.$CAPACITY_USE$IO_SARL_CORE_LIFECYCLE);
_$CAPACITY_USE$IO_SARL_CORE_LIFECYCLE$CALLER.killMe();
}
@SyntheticMember
@Pure
private boolean $behaviorUnitGuard$MemberLeft$6(final MemberLeft it, final MemberLeft occurrence) {
return (((!this.isFromMe(occurrence)) && (!this.frozen)) && (!this.$castSkill(InnerContextAccess.class, (this.$CAPACITY_USE$IO_SARL_CORE_INNERCONTEXTACCESS == null || this.$CAPACITY_USE$IO_SARL_CORE_INNERCONTEXTACCESS.get() == null) ? (this.$CAPACITY_USE$IO_SARL_CORE_INNERCONTEXTACCESS = $getSkill(InnerContextAccess.class)) : this.$CAPACITY_USE$IO_SARL_CORE_INNERCONTEXTACCESS).hasMemberAgent()));
}
@SyntheticMember
private void $behaviorUnit$MemberJoined$7(final MemberJoined occurrence) {
InnerContextAccess _$CAPACITY_USE$IO_SARL_CORE_INNERCONTEXTACCESS$CALLER = this.$castSkill(InnerContextAccess.class, (this.$CAPACITY_USE$IO_SARL_CORE_INNERCONTEXTACCESS == null || this.$CAPACITY_USE$IO_SARL_CORE_INNERCONTEXTACCESS.get() == null) ? (this.$CAPACITY_USE$IO_SARL_CORE_INNERCONTEXTACCESS = $getSkill(InnerContextAccess.class)) : this.$CAPACITY_USE$IO_SARL_CORE_INNERCONTEXTACCESS);
FireReady _fireReady = new FireReady();
_$CAPACITY_USE$IO_SARL_CORE_INNERCONTEXTACCESS$CALLER.getInnerContext().getDefaultSpace().emit(_fireReady, null);
}
@SyntheticMember
@Pure
private boolean $behaviorUnitGuard$MemberJoined$7(final MemberJoined it, final MemberJoined occurrence) {
return (((!this.isFromMe(occurrence)) && this.$castSkill(InnerContextAccess.class, (this.$CAPACITY_USE$IO_SARL_CORE_INNERCONTEXTACCESS == null || this.$CAPACITY_USE$IO_SARL_CORE_INNERCONTEXTACCESS.get() == null) ? (this.$CAPACITY_USE$IO_SARL_CORE_INNERCONTEXTACCESS = $getSkill(InnerContextAccess.class)) : this.$CAPACITY_USE$IO_SARL_CORE_INNERCONTEXTACCESS).hasMemberAgent()) && (this.$castSkill(InnerContextAccess.class, (this.$CAPACITY_USE$IO_SARL_CORE_INNERCONTEXTACCESS == null || this.$CAPACITY_USE$IO_SARL_CORE_INNERCONTEXTACCESS.get() == null) ? (this.$CAPACITY_USE$IO_SARL_CORE_INNERCONTEXTACCESS = $getSkill(InnerContextAccess.class)) : this.$CAPACITY_USE$IO_SARL_CORE_INNERCONTEXTACCESS).getMemberAgentCount() == (this.fireQuantity).intValue()));
}
@Extension
@ImportedCapacityFeature(Lifecycle.class)
@SyntheticMember
private transient ClearableReference<Skill> $CAPACITY_USE$IO_SARL_CORE_LIFECYCLE;
@SyntheticMember
@Pure
@Inline(value = "$castSkill(Lifecycle.class, (this.$CAPACITY_USE$IO_SARL_CORE_LIFECYCLE == null || this.$CAPACITY_USE$IO_SARL_CORE_LIFECYCLE.get() == null) ? (this.$CAPACITY_USE$IO_SARL_CORE_LIFECYCLE = $getSkill(Lifecycle.class)) : this.$CAPACITY_USE$IO_SARL_CORE_LIFECYCLE)", imported = Lifecycle.class)
private Lifecycle $CAPACITY_USE$IO_SARL_CORE_LIFECYCLE$CALLER() {
if (this.$CAPACITY_USE$IO_SARL_CORE_LIFECYCLE == null || this.$CAPACITY_USE$IO_SARL_CORE_LIFECYCLE.get() == null) {
this.$CAPACITY_USE$IO_SARL_CORE_LIFECYCLE = $getSkill(Lifecycle.class);
}
return $castSkill(Lifecycle.class, this.$CAPACITY_USE$IO_SARL_CORE_LIFECYCLE);
}
@Extension
@ImportedCapacityFeature(Logging.class)
@SyntheticMember
private transient ClearableReference<Skill> $CAPACITY_USE$IO_SARL_CORE_LOGGING;
@SyntheticMember
@Pure
@Inline(value = "$castSkill(Logging.class, (this.$CAPACITY_USE$IO_SARL_CORE_LOGGING == null || this.$CAPACITY_USE$IO_SARL_CORE_LOGGING.get() == null) ? (this.$CAPACITY_USE$IO_SARL_CORE_LOGGING = $getSkill(Logging.class)) : this.$CAPACITY_USE$IO_SARL_CORE_LOGGING)", imported = Logging.class)
private Logging $CAPACITY_USE$IO_SARL_CORE_LOGGING$CALLER() {
if (this.$CAPACITY_USE$IO_SARL_CORE_LOGGING == null || this.$CAPACITY_USE$IO_SARL_CORE_LOGGING.get() == null) {
this.$CAPACITY_USE$IO_SARL_CORE_LOGGING = $getSkill(Logging.class);
}
return $castSkill(Logging.class, this.$CAPACITY_USE$IO_SARL_CORE_LOGGING);
}
@Extension
@ImportedCapacityFeature(Schedules.class)
@SyntheticMember
private transient ClearableReference<Skill> $CAPACITY_USE$IO_SARL_CORE_SCHEDULES;
@SyntheticMember
@Pure
@Inline(value = "$castSkill(Schedules.class, (this.$CAPACITY_USE$IO_SARL_CORE_SCHEDULES == null || this.$CAPACITY_USE$IO_SARL_CORE_SCHEDULES.get() == null) ? (this.$CAPACITY_USE$IO_SARL_CORE_SCHEDULES = $getSkill(Schedules.class)) : this.$CAPACITY_USE$IO_SARL_CORE_SCHEDULES)", imported = Schedules.class)
private Schedules $CAPACITY_USE$IO_SARL_CORE_SCHEDULES$CALLER() {
if (this.$CAPACITY_USE$IO_SARL_CORE_SCHEDULES == null || this.$CAPACITY_USE$IO_SARL_CORE_SCHEDULES.get() == null) {
this.$CAPACITY_USE$IO_SARL_CORE_SCHEDULES = $getSkill(Schedules.class);
}
return $castSkill(Schedules.class, this.$CAPACITY_USE$IO_SARL_CORE_SCHEDULES);
}
@Extension
@ImportedCapacityFeature(Behaviors.class)
@SyntheticMember
private transient ClearableReference<Skill> $CAPACITY_USE$IO_SARL_CORE_BEHAVIORS;
@SyntheticMember
@Pure
@Inline(value = "$castSkill(Behaviors.class, (this.$CAPACITY_USE$IO_SARL_CORE_BEHAVIORS == null || this.$CAPACITY_USE$IO_SARL_CORE_BEHAVIORS.get() == null) ? (this.$CAPACITY_USE$IO_SARL_CORE_BEHAVIORS = $getSkill(Behaviors.class)) : this.$CAPACITY_USE$IO_SARL_CORE_BEHAVIORS)", imported = Behaviors.class)
private Behaviors $CAPACITY_USE$IO_SARL_CORE_BEHAVIORS$CALLER() {
if (this.$CAPACITY_USE$IO_SARL_CORE_BEHAVIORS == null || this.$CAPACITY_USE$IO_SARL_CORE_BEHAVIORS.get() == null) {
this.$CAPACITY_USE$IO_SARL_CORE_BEHAVIORS = $getSkill(Behaviors.class);
}
return $castSkill(Behaviors.class, this.$CAPACITY_USE$IO_SARL_CORE_BEHAVIORS);
}
@Extension
@ImportedCapacityFeature(DefaultContextInteractions.class)
@SyntheticMember
private transient ClearableReference<Skill> $CAPACITY_USE$IO_SARL_CORE_DEFAULTCONTEXTINTERACTIONS;
@SyntheticMember
@Pure
@Inline(value = "$castSkill(DefaultContextInteractions.class, (this.$CAPACITY_USE$IO_SARL_CORE_DEFAULTCONTEXTINTERACTIONS == null || this.$CAPACITY_USE$IO_SARL_CORE_DEFAULTCONTEXTINTERACTIONS.get() == null) ? (this.$CAPACITY_USE$IO_SARL_CORE_DEFAULTCONTEXTINTERACTIONS = $getSkill(DefaultContextInteractions.class)) : this.$CAPACITY_USE$IO_SARL_CORE_DEFAULTCONTEXTINTERACTIONS)", imported = DefaultContextInteractions.class)
private DefaultContextInteractions $CAPACITY_USE$IO_SARL_CORE_DEFAULTCONTEXTINTERACTIONS$CALLER() {
if (this.$CAPACITY_USE$IO_SARL_CORE_DEFAULTCONTEXTINTERACTIONS == null || this.$CAPACITY_USE$IO_SARL_CORE_DEFAULTCONTEXTINTERACTIONS.get() == null) {
this.$CAPACITY_USE$IO_SARL_CORE_DEFAULTCONTEXTINTERACTIONS = $getSkill(DefaultContextInteractions.class);
}
return $castSkill(DefaultContextInteractions.class, this.$CAPACITY_USE$IO_SARL_CORE_DEFAULTCONTEXTINTERACTIONS);
}
@Extension
@ImportedCapacityFeature(InnerContextAccess.class)
@SyntheticMember
private transient ClearableReference<Skill> $CAPACITY_USE$IO_SARL_CORE_INNERCONTEXTACCESS;
@SyntheticMember
@Pure
@Inline(value = "$castSkill(InnerContextAccess.class, (this.$CAPACITY_USE$IO_SARL_CORE_INNERCONTEXTACCESS == null || this.$CAPACITY_USE$IO_SARL_CORE_INNERCONTEXTACCESS.get() == null) ? (this.$CAPACITY_USE$IO_SARL_CORE_INNERCONTEXTACCESS = $getSkill(InnerContextAccess.class)) : this.$CAPACITY_USE$IO_SARL_CORE_INNERCONTEXTACCESS)", imported = InnerContextAccess.class)
private InnerContextAccess $CAPACITY_USE$IO_SARL_CORE_INNERCONTEXTACCESS$CALLER() {
if (this.$CAPACITY_USE$IO_SARL_CORE_INNERCONTEXTACCESS == null || this.$CAPACITY_USE$IO_SARL_CORE_INNERCONTEXTACCESS.get() == null) {
this.$CAPACITY_USE$IO_SARL_CORE_INNERCONTEXTACCESS = $getSkill(InnerContextAccess.class);
}
return $castSkill(InnerContextAccess.class, this.$CAPACITY_USE$IO_SARL_CORE_INNERCONTEXTACCESS);
}
@Extension
@ImportedCapacityFeature(ExternalContextAccess.class)
@SyntheticMember
private transient ClearableReference<Skill> $CAPACITY_USE$IO_SARL_CORE_EXTERNALCONTEXTACCESS;
@SyntheticMember
@Pure
@Inline(value = "$castSkill(ExternalContextAccess.class, (this.$CAPACITY_USE$IO_SARL_CORE_EXTERNALCONTEXTACCESS == null || this.$CAPACITY_USE$IO_SARL_CORE_EXTERNALCONTEXTACCESS.get() == null) ? (this.$CAPACITY_USE$IO_SARL_CORE_EXTERNALCONTEXTACCESS = $getSkill(ExternalContextAccess.class)) : this.$CAPACITY_USE$IO_SARL_CORE_EXTERNALCONTEXTACCESS)", imported = ExternalContextAccess.class)
private ExternalContextAccess $CAPACITY_USE$IO_SARL_CORE_EXTERNALCONTEXTACCESS$CALLER() {
if (this.$CAPACITY_USE$IO_SARL_CORE_EXTERNALCONTEXTACCESS == null || this.$CAPACITY_USE$IO_SARL_CORE_EXTERNALCONTEXTACCESS.get() == null) {
this.$CAPACITY_USE$IO_SARL_CORE_EXTERNALCONTEXTACCESS = $getSkill(ExternalContextAccess.class);
}
return $castSkill(ExternalContextAccess.class, this.$CAPACITY_USE$IO_SARL_CORE_EXTERNALCONTEXTACCESS);
}
@SyntheticMember
@PerceptGuardEvaluator
private void $guardEvaluator$Initialize(final Initialize occurrence, final Collection<Runnable> ___SARLlocal_runnableCollection) {
assert occurrence != null;
assert ___SARLlocal_runnableCollection != null;
___SARLlocal_runnableCollection.add(() -> $behaviorUnit$Initialize$3(occurrence));
}
@SyntheticMember
@PerceptGuardEvaluator
private void $guardEvaluator$UpdateRocketPosition(final UpdateRocketPosition occurrence, final Collection<Runnable> ___SARLlocal_runnableCollection) {
assert occurrence != null;
assert ___SARLlocal_runnableCollection != null;
if ($behaviorUnitGuard$UpdateRocketPosition$4(occurrence, occurrence)) {
___SARLlocal_runnableCollection.add(() -> $behaviorUnit$UpdateRocketPosition$4(occurrence));
}
}
@SyntheticMember
@PerceptGuardEvaluator
private void $guardEvaluator$Freeze(final Freeze occurrence, final Collection<Runnable> ___SARLlocal_runnableCollection) {
assert occurrence != null;
assert ___SARLlocal_runnableCollection != null;
___SARLlocal_runnableCollection.add(() -> $behaviorUnit$Freeze$2(occurrence));
}
@SyntheticMember
@PerceptGuardEvaluator
private void $guardEvaluator$MemberLeft(final MemberLeft occurrence, final Collection<Runnable> ___SARLlocal_runnableCollection) {
assert occurrence != null;
assert ___SARLlocal_runnableCollection != null;
if ($behaviorUnitGuard$MemberLeft$6(occurrence, occurrence)) {
___SARLlocal_runnableCollection.add(() -> $behaviorUnit$MemberLeft$6(occurrence));
}
}
@SyntheticMember
@PerceptGuardEvaluator
private void $guardEvaluator$Explode(final Explode occurrence, final Collection<Runnable> ___SARLlocal_runnableCollection) {
assert occurrence != null;
assert ___SARLlocal_runnableCollection != null;
___SARLlocal_runnableCollection.add(() -> $behaviorUnit$Explode$5(occurrence));
}
@SyntheticMember
@PerceptGuardEvaluator
private void $guardEvaluator$Exit(final Exit occurrence, final Collection<Runnable> ___SARLlocal_runnableCollection) {
assert occurrence != null;
assert ___SARLlocal_runnableCollection != null;
if ($behaviorUnitGuard$Exit$0(occurrence, occurrence)) {
___SARLlocal_runnableCollection.add(() -> $behaviorUnit$Exit$0(occurrence));
}
if ($behaviorUnitGuard$Exit$1(occurrence, occurrence)) {
___SARLlocal_runnableCollection.add(() -> $behaviorUnit$Exit$1(occurrence));
}
}
@SyntheticMember
@PerceptGuardEvaluator
private void $guardEvaluator$MemberJoined(final MemberJoined occurrence, final Collection<Runnable> ___SARLlocal_runnableCollection) {
assert occurrence != null;
assert ___SARLlocal_runnableCollection != null;
if ($behaviorUnitGuard$MemberJoined$7(occurrence, occurrence)) {
___SARLlocal_runnableCollection.add(() -> $behaviorUnit$MemberJoined$7(occurrence));
}
}
@Override
@Pure
@SyntheticMember
public boolean equals(final Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Rocket other = (Rocket) obj;
if (this.x == null) {
if (other.x != null)
return false;
} else if (!this.x.equals(other.x))
return false;
if (this.y == null) {
if (other.y != null)
return false;
} else if (!this.y.equals(other.y))
return false;
if (this.gravity == null) {
if (other.gravity != null)
return false;
} else if (!this.gravity.equals(other.gravity))
return false;
if (this.speedx == null) {
if (other.speedx != null)
return false;
} else if (!this.speedx.equals(other.speedx))
return false;
if (this.speedy == null) {
if (other.speedy != null)
return false;
} else if (!this.speedy.equals(other.speedy))
return false;
if (this.fireQuantity == null) {
if (other.fireQuantity != null)
return false;
} else if (!this.fireQuantity.equals(other.fireQuantity))
return false;
if (this.lifetime == null) {
if (other.lifetime != null)
return false;
} else if (!this.lifetime.equals(other.lifetime))
return false;
if (other.frozen != this.frozen)
return false;
if (other.exploded != this.exploded)
return false;
if (other.exited != this.exited)
return false;
if (this.grid == null) {
if (other.grid != null)
return false;
} else if (!this.grid.equals(other.grid))
return false;
if (this.id == null) {
if (other.id != null)
return false;
} else if (!this.id.equals(other.id))
return false;
if (this.move == null) {
if (other.move != null)
return false;
} else if (!this.move.equals(other.move))
return false;
return super.equals(obj);
}
@Override
@Pure
@SyntheticMember
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result + ((this.x== null) ? 0 : this.x.hashCode());
result = prime * result + ((this.y== null) ? 0 : this.y.hashCode());
result = prime * result + ((this.gravity== null) ? 0 : this.gravity.hashCode());
result = prime * result + ((this.speedx== null) ? 0 : this.speedx.hashCode());
result = prime * result + ((this.speedy== null) ? 0 : this.speedy.hashCode());
result = prime * result + ((this.fireQuantity== null) ? 0 : this.fireQuantity.hashCode());
result = prime * result + ((this.lifetime== null) ? 0 : this.lifetime.hashCode());
result = prime * result + (this.frozen ? 1231 : 1237);
result = prime * result + (this.exploded ? 1231 : 1237);
result = prime * result + (this.exited ? 1231 : 1237);
result = prime * result + ((this.grid== null) ? 0 : this.grid.hashCode());
result = prime * result + ((this.id== null) ? 0 : this.id.hashCode());
result = prime * result + ((this.move== null) ? 0 : this.move.hashCode());
return result;
}
@SyntheticMember
public Rocket(final UUID parentID, final UUID agentID) {
super(parentID, agentID);
}
@SyntheticMember
@Inject
public Rocket(final BuiltinCapacitiesProvider provider, final UUID parentID, final UUID agentID) {
super(provider, parentID, agentID);
}
}