mirror of
https://github.com/klmp200/sarl-fireworks.git
synced 2024-11-24 18:14:23 +00:00
Remove xtext generated files
This commit is contained in:
parent
3df4ebb395
commit
77013351d9
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,23 +0,0 @@
|
|||||||
package io.sarl.demos.fireworks;
|
|
||||||
|
|
||||||
import io.sarl.lang.annotation.SarlSpecification;
|
|
||||||
import io.sarl.lang.annotation.SyntheticMember;
|
|
||||||
import io.sarl.lang.core.Address;
|
|
||||||
import io.sarl.lang.core.Event;
|
|
||||||
|
|
||||||
@SarlSpecification("0.5")
|
|
||||||
@SuppressWarnings("all")
|
|
||||||
public class CreateArea extends Event {
|
|
||||||
@SyntheticMember
|
|
||||||
public CreateArea() {
|
|
||||||
super();
|
|
||||||
}
|
|
||||||
|
|
||||||
@SyntheticMember
|
|
||||||
public CreateArea(final Address source) {
|
|
||||||
super(source);
|
|
||||||
}
|
|
||||||
|
|
||||||
@SyntheticMember
|
|
||||||
private final static long serialVersionUID = 588368462L;
|
|
||||||
}
|
|
@ -1,23 +0,0 @@
|
|||||||
package io.sarl.demos.fireworks;
|
|
||||||
|
|
||||||
import io.sarl.lang.annotation.SarlSpecification;
|
|
||||||
import io.sarl.lang.annotation.SyntheticMember;
|
|
||||||
import io.sarl.lang.core.Address;
|
|
||||||
import io.sarl.lang.core.Event;
|
|
||||||
|
|
||||||
@SarlSpecification("0.5")
|
|
||||||
@SuppressWarnings("all")
|
|
||||||
public class Exit extends Event {
|
|
||||||
@SyntheticMember
|
|
||||||
public Exit() {
|
|
||||||
super();
|
|
||||||
}
|
|
||||||
|
|
||||||
@SyntheticMember
|
|
||||||
public Exit(final Address source) {
|
|
||||||
super(source);
|
|
||||||
}
|
|
||||||
|
|
||||||
@SyntheticMember
|
|
||||||
private final static long serialVersionUID = 588368462L;
|
|
||||||
}
|
|
@ -1,23 +0,0 @@
|
|||||||
package io.sarl.demos.fireworks;
|
|
||||||
|
|
||||||
import io.sarl.lang.annotation.SarlSpecification;
|
|
||||||
import io.sarl.lang.annotation.SyntheticMember;
|
|
||||||
import io.sarl.lang.core.Address;
|
|
||||||
import io.sarl.lang.core.Event;
|
|
||||||
|
|
||||||
@SarlSpecification("0.5")
|
|
||||||
@SuppressWarnings("all")
|
|
||||||
public class Explode extends Event {
|
|
||||||
@SyntheticMember
|
|
||||||
public Explode() {
|
|
||||||
super();
|
|
||||||
}
|
|
||||||
|
|
||||||
@SyntheticMember
|
|
||||||
public Explode(final Address source) {
|
|
||||||
super(source);
|
|
||||||
}
|
|
||||||
|
|
||||||
@SyntheticMember
|
|
||||||
private final static long serialVersionUID = 588368462L;
|
|
||||||
}
|
|
@ -1,458 +0,0 @@
|
|||||||
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.Lifecycle;
|
|
||||||
import io.sarl.core.Logging;
|
|
||||||
import io.sarl.core.Schedules;
|
|
||||||
import io.sarl.core.Time;
|
|
||||||
import io.sarl.demos.fireworks.Exit;
|
|
||||||
import io.sarl.demos.fireworks.FireReady;
|
|
||||||
import io.sarl.demos.fireworks.Freeze;
|
|
||||||
import io.sarl.demos.fireworks.Positions;
|
|
||||||
import io.sarl.demos.fireworks.UpdateFirePosition;
|
|
||||||
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 io.sarl.util.Scopes;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.UUID;
|
|
||||||
import java.util.Vector;
|
|
||||||
import java.util.function.Consumer;
|
|
||||||
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.IterableExtensions;
|
|
||||||
import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
|
|
||||||
import org.eclipse.xtext.xbase.lib.Procedures.Procedure2;
|
|
||||||
import org.eclipse.xtext.xbase.lib.Pure;
|
|
||||||
|
|
||||||
@SarlSpecification("0.5")
|
|
||||||
@SuppressWarnings("all")
|
|
||||||
public class Fire extends Agent {
|
|
||||||
private List<Double> x;
|
|
||||||
|
|
||||||
private List<Double> y;
|
|
||||||
|
|
||||||
private int lifetime = 300;
|
|
||||||
|
|
||||||
private boolean frozen = false;
|
|
||||||
|
|
||||||
private boolean destroyed = false;
|
|
||||||
|
|
||||||
private boolean exited = false;
|
|
||||||
|
|
||||||
private Positions grid;
|
|
||||||
|
|
||||||
private Double xf;
|
|
||||||
|
|
||||||
private Double yf;
|
|
||||||
|
|
||||||
private UUID id = UUID.randomUUID();
|
|
||||||
|
|
||||||
private UUID parentID;
|
|
||||||
|
|
||||||
private AgentTask move;
|
|
||||||
|
|
||||||
private UUID parentAgent;
|
|
||||||
|
|
||||||
@SyntheticMember
|
|
||||||
private void $behaviorUnit$Freeze$0(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);
|
|
||||||
} else {
|
|
||||||
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);
|
|
||||||
UpdateFirePosition _updateFirePosition = new UpdateFirePosition();
|
|
||||||
_$CAPACITY_USE$IO_SARL_CORE_BEHAVIORS$CALLER.wake(_updateFirePosition);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@SyntheticMember
|
|
||||||
private void $behaviorUnit$Initialize$1(final Initialize occurrence) {
|
|
||||||
ArrayList<Double> _arrayList = new ArrayList<Double>();
|
|
||||||
this.x = _arrayList;
|
|
||||||
ArrayList<Double> _arrayList_1 = new ArrayList<Double>();
|
|
||||||
this.y = _arrayList_1;
|
|
||||||
boolean _equals = Integer.valueOf(((List<Object>)Conversions.doWrapArray(occurrence.parameters)).size()).equals(Integer.valueOf(4));
|
|
||||||
if (_equals) {
|
|
||||||
Object _get = occurrence.parameters[0];
|
|
||||||
this.x.add(((Double) _get));
|
|
||||||
Object _get_1 = occurrence.parameters[1];
|
|
||||||
this.y.add(((Double) _get_1));
|
|
||||||
Object _get_2 = occurrence.parameters[2];
|
|
||||||
this.grid = ((Positions) _get_2);
|
|
||||||
Object _get_3 = occurrence.parameters[3];
|
|
||||||
this.parentID = ((UUID) _get_3);
|
|
||||||
} else {
|
|
||||||
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("Error in fire Initialize : bad parameter number");
|
|
||||||
}
|
|
||||||
this.parentAgent = occurrence.spawner;
|
|
||||||
double _random = Math.random();
|
|
||||||
double _multiply = (_random * 10.0);
|
|
||||||
double _random_1 = Math.random();
|
|
||||||
double _multiply_1 = (_random_1 * 5);
|
|
||||||
double _minus = (_multiply - _multiply_1);
|
|
||||||
this.xf = Double.valueOf(_minus);
|
|
||||||
double _random_2 = Math.random();
|
|
||||||
double _multiply_2 = (_random_2 * 10.0);
|
|
||||||
double _plus = (_multiply_2 + 1.0);
|
|
||||||
this.yf = Double.valueOf(_plus);
|
|
||||||
}
|
|
||||||
|
|
||||||
@SyntheticMember
|
|
||||||
private void $behaviorUnit$FireReady$2(final FireReady occurrence) {
|
|
||||||
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);
|
|
||||||
UpdateFirePosition _updateFirePosition = new UpdateFirePosition();
|
|
||||||
_$CAPACITY_USE$IO_SARL_CORE_BEHAVIORS$CALLER.wake(_updateFirePosition);
|
|
||||||
} 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$UpdateFirePosition$3(final UpdateFirePosition occurrence) {
|
|
||||||
Double _last = IterableExtensions.<Double>last(this.x);
|
|
||||||
double newx = DoubleExtensions.operator_plus(_last, this.xf);
|
|
||||||
Double _last_1 = IterableExtensions.<Double>last(this.y);
|
|
||||||
double newy = DoubleExtensions.operator_plus(_last_1, this.yf);
|
|
||||||
this.x.add(Double.valueOf(newx));
|
|
||||||
this.y.add(Double.valueOf(newy));
|
|
||||||
if ((this.grid != null)) {
|
|
||||||
ArrayList<Vector<Double>> list = new ArrayList<Vector<Double>>();
|
|
||||||
final Consumer<Double> _function = (Double pos) -> {
|
|
||||||
Vector<Double> nvect = new Vector<Double>(2);
|
|
||||||
nvect.add(pos);
|
|
||||||
list.add(nvect);
|
|
||||||
};
|
|
||||||
this.x.forEach(_function);
|
|
||||||
final Procedure2<Double, Integer> _function_1 = (Double pos, Integer i) -> {
|
|
||||||
Vector<Double> nvect = list.get((i).intValue());
|
|
||||||
nvect.add(pos);
|
|
||||||
list.set((i).intValue(), nvect);
|
|
||||||
};
|
|
||||||
IterableExtensions.<Double>forEach(this.y, _function_1);
|
|
||||||
this.grid.setFirePosition(this.id, this.parentID, list);
|
|
||||||
}
|
|
||||||
this.lifetime = (this.lifetime - 10);
|
|
||||||
if ((this.lifetime <= 0)) {
|
|
||||||
this.grid.removeFirePosition(this.id);
|
|
||||||
this.cleanBeforeExit();
|
|
||||||
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_2 = (Agent it) -> {
|
|
||||||
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();
|
|
||||||
};
|
|
||||||
_$CAPACITY_USE$IO_SARL_CORE_SCHEDULES$CALLER.in(1000, _function_2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@SyntheticMember
|
|
||||||
@Pure
|
|
||||||
private boolean $behaviorUnitGuard$UpdateFirePosition$3(final UpdateFirePosition it, final UpdateFirePosition occurrence) {
|
|
||||||
return ((this.isFromMe(occurrence) && (!this.frozen)) && (!this.destroyed));
|
|
||||||
}
|
|
||||||
|
|
||||||
protected boolean cleanBeforeExit() {
|
|
||||||
boolean _xblockexpression = false;
|
|
||||||
{
|
|
||||||
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.exited = true;
|
|
||||||
_xblockexpression = this.destroyed = true;
|
|
||||||
}
|
|
||||||
return _xblockexpression;
|
|
||||||
}
|
|
||||||
|
|
||||||
@SyntheticMember
|
|
||||||
private void $behaviorUnit$Exit$4(final Exit occurrence) {
|
|
||||||
this.frozen = true;
|
|
||||||
this.cleanBeforeExit();
|
|
||||||
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();
|
|
||||||
DefaultContextInteractions _$CAPACITY_USE$IO_SARL_CORE_DEFAULTCONTEXTINTERACTIONS$CALLER_1 = 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);
|
|
||||||
_$CAPACITY_USE$IO_SARL_CORE_DEFAULTCONTEXTINTERACTIONS$CALLER.emit(_exit, Scopes.addresses(_$CAPACITY_USE$IO_SARL_CORE_DEFAULTCONTEXTINTERACTIONS$CALLER_1.getDefaultSpace().getAddress(this.parentAgent)));
|
|
||||||
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$4(final Exit it, final Exit occurrence) {
|
|
||||||
return ((!this.exited) && it.isFrom(this.getParentID()));
|
|
||||||
}
|
|
||||||
|
|
||||||
@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(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(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);
|
|
||||||
}
|
|
||||||
|
|
||||||
@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(Time.class)
|
|
||||||
@SyntheticMember
|
|
||||||
private transient ClearableReference<Skill> $CAPACITY_USE$IO_SARL_CORE_TIME;
|
|
||||||
|
|
||||||
@SyntheticMember
|
|
||||||
@Pure
|
|
||||||
@Inline(value = "$castSkill(Time.class, (this.$CAPACITY_USE$IO_SARL_CORE_TIME == null || this.$CAPACITY_USE$IO_SARL_CORE_TIME.get() == null) ? (this.$CAPACITY_USE$IO_SARL_CORE_TIME = $getSkill(Time.class)) : this.$CAPACITY_USE$IO_SARL_CORE_TIME)", imported = Time.class)
|
|
||||||
private Time $CAPACITY_USE$IO_SARL_CORE_TIME$CALLER() {
|
|
||||||
if (this.$CAPACITY_USE$IO_SARL_CORE_TIME == null || this.$CAPACITY_USE$IO_SARL_CORE_TIME.get() == null) {
|
|
||||||
this.$CAPACITY_USE$IO_SARL_CORE_TIME = $getSkill(Time.class);
|
|
||||||
}
|
|
||||||
return $castSkill(Time.class, this.$CAPACITY_USE$IO_SARL_CORE_TIME);
|
|
||||||
}
|
|
||||||
|
|
||||||
@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$1(occurrence));
|
|
||||||
}
|
|
||||||
|
|
||||||
@SyntheticMember
|
|
||||||
@PerceptGuardEvaluator
|
|
||||||
private void $guardEvaluator$FireReady(final FireReady occurrence, final Collection<Runnable> ___SARLlocal_runnableCollection) {
|
|
||||||
assert occurrence != null;
|
|
||||||
assert ___SARLlocal_runnableCollection != null;
|
|
||||||
___SARLlocal_runnableCollection.add(() -> $behaviorUnit$FireReady$2(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$0(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$4(occurrence, occurrence)) {
|
|
||||||
___SARLlocal_runnableCollection.add(() -> $behaviorUnit$Exit$4(occurrence));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@SyntheticMember
|
|
||||||
@PerceptGuardEvaluator
|
|
||||||
private void $guardEvaluator$UpdateFirePosition(final UpdateFirePosition occurrence, final Collection<Runnable> ___SARLlocal_runnableCollection) {
|
|
||||||
assert occurrence != null;
|
|
||||||
assert ___SARLlocal_runnableCollection != null;
|
|
||||||
if ($behaviorUnitGuard$UpdateFirePosition$3(occurrence, occurrence)) {
|
|
||||||
___SARLlocal_runnableCollection.add(() -> $behaviorUnit$UpdateFirePosition$3(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;
|
|
||||||
Fire other = (Fire) 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 (other.lifetime != this.lifetime)
|
|
||||||
return false;
|
|
||||||
if (other.frozen != this.frozen)
|
|
||||||
return false;
|
|
||||||
if (other.destroyed != this.destroyed)
|
|
||||||
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.xf == null) {
|
|
||||||
if (other.xf != null)
|
|
||||||
return false;
|
|
||||||
} else if (!this.xf.equals(other.xf))
|
|
||||||
return false;
|
|
||||||
if (this.yf == null) {
|
|
||||||
if (other.yf != null)
|
|
||||||
return false;
|
|
||||||
} else if (!this.yf.equals(other.yf))
|
|
||||||
return false;
|
|
||||||
if (this.id == null) {
|
|
||||||
if (other.id != null)
|
|
||||||
return false;
|
|
||||||
} else if (!this.id.equals(other.id))
|
|
||||||
return false;
|
|
||||||
if (this.parentID == null) {
|
|
||||||
if (other.parentID != null)
|
|
||||||
return false;
|
|
||||||
} else if (!this.parentID.equals(other.parentID))
|
|
||||||
return false;
|
|
||||||
if (this.move == null) {
|
|
||||||
if (other.move != null)
|
|
||||||
return false;
|
|
||||||
} else if (!this.move.equals(other.move))
|
|
||||||
return false;
|
|
||||||
if (this.parentAgent == null) {
|
|
||||||
if (other.parentAgent != null)
|
|
||||||
return false;
|
|
||||||
} else if (!this.parentAgent.equals(other.parentAgent))
|
|
||||||
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.lifetime;
|
|
||||||
result = prime * result + (this.frozen ? 1231 : 1237);
|
|
||||||
result = prime * result + (this.destroyed ? 1231 : 1237);
|
|
||||||
result = prime * result + (this.exited ? 1231 : 1237);
|
|
||||||
result = prime * result + ((this.grid== null) ? 0 : this.grid.hashCode());
|
|
||||||
result = prime * result + ((this.xf== null) ? 0 : this.xf.hashCode());
|
|
||||||
result = prime * result + ((this.yf== null) ? 0 : this.yf.hashCode());
|
|
||||||
result = prime * result + ((this.id== null) ? 0 : this.id.hashCode());
|
|
||||||
result = prime * result + ((this.parentID== null) ? 0 : this.parentID.hashCode());
|
|
||||||
result = prime * result + ((this.move== null) ? 0 : this.move.hashCode());
|
|
||||||
result = prime * result + ((this.parentAgent== null) ? 0 : this.parentAgent.hashCode());
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
@SyntheticMember
|
|
||||||
public Fire(final UUID parentID, final UUID agentID) {
|
|
||||||
super(parentID, agentID);
|
|
||||||
}
|
|
||||||
|
|
||||||
@SyntheticMember
|
|
||||||
@Inject
|
|
||||||
public Fire(final BuiltinCapacitiesProvider provider, final UUID parentID, final UUID agentID) {
|
|
||||||
super(provider, parentID, agentID);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,79 +0,0 @@
|
|||||||
package io.sarl.demos.fireworks;
|
|
||||||
|
|
||||||
import io.sarl.lang.annotation.SarlSpecification;
|
|
||||||
import io.sarl.lang.annotation.SyntheticMember;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Vector;
|
|
||||||
import javafx.scene.paint.Color;
|
|
||||||
import org.eclipse.xtext.xbase.lib.Pure;
|
|
||||||
|
|
||||||
@SarlSpecification("0.5")
|
|
||||||
@SuppressWarnings("all")
|
|
||||||
public class FirePos {
|
|
||||||
public final int FIREREFRESHDELAY = 100;
|
|
||||||
|
|
||||||
private List<Vector<Double>> positions;
|
|
||||||
|
|
||||||
private Color color;
|
|
||||||
|
|
||||||
@Pure
|
|
||||||
public List<Vector<Double>> getPositions() {
|
|
||||||
return this.positions;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<Vector<Double>> setPositions(final List<Vector<Double>> positions) {
|
|
||||||
return this.positions = positions;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Pure
|
|
||||||
public Color getColor() {
|
|
||||||
return this.color;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Color setColor(final Color color) {
|
|
||||||
return this.color = color;
|
|
||||||
}
|
|
||||||
|
|
||||||
@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;
|
|
||||||
FirePos other = (FirePos) obj;
|
|
||||||
if (other.FIREREFRESHDELAY != this.FIREREFRESHDELAY)
|
|
||||||
return false;
|
|
||||||
if (this.positions == null) {
|
|
||||||
if (other.positions != null)
|
|
||||||
return false;
|
|
||||||
} else if (!this.positions.equals(other.positions))
|
|
||||||
return false;
|
|
||||||
if (this.color == null) {
|
|
||||||
if (other.color != null)
|
|
||||||
return false;
|
|
||||||
} else if (!this.color.equals(other.color))
|
|
||||||
return false;
|
|
||||||
return super.equals(obj);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@Pure
|
|
||||||
@SyntheticMember
|
|
||||||
public int hashCode() {
|
|
||||||
final int prime = 31;
|
|
||||||
int result = super.hashCode();
|
|
||||||
result = prime * result + this.FIREREFRESHDELAY;
|
|
||||||
result = prime * result + ((this.positions== null) ? 0 : this.positions.hashCode());
|
|
||||||
result = prime * result + ((this.color== null) ? 0 : this.color.hashCode());
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
@SyntheticMember
|
|
||||||
public FirePos() {
|
|
||||||
super();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,23 +0,0 @@
|
|||||||
package io.sarl.demos.fireworks;
|
|
||||||
|
|
||||||
import io.sarl.lang.annotation.SarlSpecification;
|
|
||||||
import io.sarl.lang.annotation.SyntheticMember;
|
|
||||||
import io.sarl.lang.core.Address;
|
|
||||||
import io.sarl.lang.core.Event;
|
|
||||||
|
|
||||||
@SarlSpecification("0.5")
|
|
||||||
@SuppressWarnings("all")
|
|
||||||
public class FireReady extends Event {
|
|
||||||
@SyntheticMember
|
|
||||||
public FireReady() {
|
|
||||||
super();
|
|
||||||
}
|
|
||||||
|
|
||||||
@SyntheticMember
|
|
||||||
public FireReady(final Address source) {
|
|
||||||
super(source);
|
|
||||||
}
|
|
||||||
|
|
||||||
@SyntheticMember
|
|
||||||
private final static long serialVersionUID = 588368462L;
|
|
||||||
}
|
|
@ -2,13 +2,13 @@ package io.sarl.demos.fireworks;
|
|||||||
|
|
||||||
import io.janusproject.Boot;
|
import io.janusproject.Boot;
|
||||||
import io.janusproject.kernel.Kernel;
|
import io.janusproject.kernel.Kernel;
|
||||||
import io.sarl.demos.fireworks.FXMLViewerController;
|
import io.sarl.demos.fireworks.agents.LaunchingArea;
|
||||||
import io.sarl.demos.fireworks.LaunchingArea;
|
import io.sarl.demos.fireworks.gui.FXMLViewerController;
|
||||||
import io.sarl.lang.annotation.SarlSpecification;
|
import io.sarl.lang.annotation.SarlSpecification;
|
||||||
import io.sarl.lang.annotation.SyntheticMember;
|
import io.sarl.lang.annotation.SyntheticMember;
|
||||||
import org.eclipse.xtext.xbase.lib.Exceptions;
|
import org.eclipse.xtext.xbase.lib.Exceptions;
|
||||||
|
|
||||||
@SarlSpecification("0.5")
|
@SarlSpecification("0.6")
|
||||||
@SuppressWarnings("all")
|
@SuppressWarnings("all")
|
||||||
public class Firework {
|
public class Firework {
|
||||||
public static Kernel main(final FXMLViewerController controller) {
|
public static Kernel main(final FXMLViewerController controller) {
|
||||||
|
@ -1,56 +0,0 @@
|
|||||||
package io.sarl.demos.fireworks;
|
|
||||||
|
|
||||||
import io.sarl.lang.annotation.SarlSpecification;
|
|
||||||
import io.sarl.lang.annotation.SyntheticMember;
|
|
||||||
import io.sarl.lang.core.Event;
|
|
||||||
import org.eclipse.xtext.xbase.lib.Pure;
|
|
||||||
|
|
||||||
@SarlSpecification("0.5")
|
|
||||||
@SuppressWarnings("all")
|
|
||||||
public class Freeze extends Event {
|
|
||||||
public boolean value;
|
|
||||||
|
|
||||||
public Freeze(final boolean value) {
|
|
||||||
this.value = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
@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;
|
|
||||||
Freeze other = (Freeze) obj;
|
|
||||||
if (other.value != this.value)
|
|
||||||
return false;
|
|
||||||
return super.equals(obj);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@Pure
|
|
||||||
@SyntheticMember
|
|
||||||
public int hashCode() {
|
|
||||||
final int prime = 31;
|
|
||||||
int result = super.hashCode();
|
|
||||||
result = prime * result + (this.value ? 1231 : 1237);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a String representation of the Freeze event's attributes only.
|
|
||||||
*/
|
|
||||||
@SyntheticMember
|
|
||||||
@Pure
|
|
||||||
protected String attributesToString() {
|
|
||||||
StringBuilder result = new StringBuilder(super.attributesToString());
|
|
||||||
result.append("value = ").append(this.value);
|
|
||||||
return result.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
@SyntheticMember
|
|
||||||
private final static long serialVersionUID = 2771119382L;
|
|
||||||
}
|
|
@ -1,23 +0,0 @@
|
|||||||
package io.sarl.demos.fireworks;
|
|
||||||
|
|
||||||
import io.sarl.lang.annotation.SarlSpecification;
|
|
||||||
import io.sarl.lang.annotation.SyntheticMember;
|
|
||||||
import io.sarl.lang.core.Address;
|
|
||||||
import io.sarl.lang.core.Event;
|
|
||||||
|
|
||||||
@SarlSpecification("0.5")
|
|
||||||
@SuppressWarnings("all")
|
|
||||||
public class KillFire extends Event {
|
|
||||||
@SyntheticMember
|
|
||||||
public KillFire() {
|
|
||||||
super();
|
|
||||||
}
|
|
||||||
|
|
||||||
@SyntheticMember
|
|
||||||
public KillFire(final Address source) {
|
|
||||||
super(source);
|
|
||||||
}
|
|
||||||
|
|
||||||
@SyntheticMember
|
|
||||||
private final static long serialVersionUID = 588368462L;
|
|
||||||
}
|
|
@ -1,23 +0,0 @@
|
|||||||
package io.sarl.demos.fireworks;
|
|
||||||
|
|
||||||
import io.sarl.lang.annotation.SarlSpecification;
|
|
||||||
import io.sarl.lang.annotation.SyntheticMember;
|
|
||||||
import io.sarl.lang.core.Address;
|
|
||||||
import io.sarl.lang.core.Event;
|
|
||||||
|
|
||||||
@SarlSpecification("0.5")
|
|
||||||
@SuppressWarnings("all")
|
|
||||||
public class KillRocket extends Event {
|
|
||||||
@SyntheticMember
|
|
||||||
public KillRocket() {
|
|
||||||
super();
|
|
||||||
}
|
|
||||||
|
|
||||||
@SyntheticMember
|
|
||||||
public KillRocket(final Address source) {
|
|
||||||
super(source);
|
|
||||||
}
|
|
||||||
|
|
||||||
@SyntheticMember
|
|
||||||
private final static long serialVersionUID = 588368462L;
|
|
||||||
}
|
|
@ -1,23 +0,0 @@
|
|||||||
package io.sarl.demos.fireworks;
|
|
||||||
|
|
||||||
import io.sarl.lang.annotation.SarlSpecification;
|
|
||||||
import io.sarl.lang.annotation.SyntheticMember;
|
|
||||||
import io.sarl.lang.core.Address;
|
|
||||||
import io.sarl.lang.core.Event;
|
|
||||||
|
|
||||||
@SarlSpecification("0.5")
|
|
||||||
@SuppressWarnings("all")
|
|
||||||
public class Launch extends Event {
|
|
||||||
@SyntheticMember
|
|
||||||
public Launch() {
|
|
||||||
super();
|
|
||||||
}
|
|
||||||
|
|
||||||
@SyntheticMember
|
|
||||||
public Launch(final Address source) {
|
|
||||||
super(source);
|
|
||||||
}
|
|
||||||
|
|
||||||
@SyntheticMember
|
|
||||||
private final static long serialVersionUID = 588368462L;
|
|
||||||
}
|
|
@ -1,391 +0,0 @@
|
|||||||
package io.sarl.demos.fireworks;
|
|
||||||
|
|
||||||
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.demos.fireworks.CreateArea;
|
|
||||||
import io.sarl.demos.fireworks.Exit;
|
|
||||||
import io.sarl.demos.fireworks.FXMLViewerController;
|
|
||||||
import io.sarl.demos.fireworks.Freeze;
|
|
||||||
import io.sarl.demos.fireworks.Launch;
|
|
||||||
import io.sarl.demos.fireworks.Positions;
|
|
||||||
import io.sarl.demos.fireworks.RocketLauncher;
|
|
||||||
import io.sarl.demos.fireworks.SetupSettings;
|
|
||||||
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 io.sarl.util.OpenEventSpace;
|
|
||||||
import io.sarl.util.OpenEventSpaceSpecification;
|
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Random;
|
|
||||||
import java.util.UUID;
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import org.eclipse.xtext.xbase.lib.Conversions;
|
|
||||||
import org.eclipse.xtext.xbase.lib.Extension;
|
|
||||||
import org.eclipse.xtext.xbase.lib.Inline;
|
|
||||||
import org.eclipse.xtext.xbase.lib.Pure;
|
|
||||||
|
|
||||||
@SarlSpecification("0.5")
|
|
||||||
@SuppressWarnings("all")
|
|
||||||
public class LaunchingArea extends Agent {
|
|
||||||
private Integer rocketsQuantity;
|
|
||||||
|
|
||||||
private Integer fireQuantity;
|
|
||||||
|
|
||||||
private Double gravity;
|
|
||||||
|
|
||||||
private Positions grid = new Positions();
|
|
||||||
|
|
||||||
private double maxWidth = 10.0;
|
|
||||||
|
|
||||||
private boolean exited = false;
|
|
||||||
|
|
||||||
@SyntheticMember
|
|
||||||
private void $behaviorUnit$SetupSettings$0(final SetupSettings occurrence) {
|
|
||||||
this.rocketsQuantity = occurrence.rocketsQuantity;
|
|
||||||
this.fireQuantity = occurrence.fireQuatity;
|
|
||||||
this.gravity = occurrence.gravity;
|
|
||||||
this.maxWidth = (occurrence.maxWidth).doubleValue();
|
|
||||||
}
|
|
||||||
|
|
||||||
@SyntheticMember
|
|
||||||
private void $behaviorUnit$Exit$1(final Exit occurrence) {
|
|
||||||
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$1(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$2(final Exit occurrence) {
|
|
||||||
this.exited = 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$2(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$Initialize$3(final Initialize occurrence) {
|
|
||||||
this.rocketsQuantity = Integer.valueOf(20);
|
|
||||||
this.fireQuantity = Integer.valueOf(30);
|
|
||||||
this.gravity = Double.valueOf(0.5);
|
|
||||||
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("Setup Area");
|
|
||||||
}
|
|
||||||
|
|
||||||
@SyntheticMember
|
|
||||||
@Pure
|
|
||||||
private boolean $behaviorUnitGuard$Initialize$3(final Initialize it, final Initialize occurrence) {
|
|
||||||
boolean _isEmpty = ((List<Object>)Conversions.doWrapArray(occurrence.parameters)).isEmpty();
|
|
||||||
return _isEmpty;
|
|
||||||
}
|
|
||||||
|
|
||||||
@SyntheticMember
|
|
||||||
private void $behaviorUnit$Initialize$4(final Initialize occurrence) {
|
|
||||||
Object _get = occurrence.parameters[0];
|
|
||||||
FXMLViewerController ctrl = ((FXMLViewerController) _get);
|
|
||||||
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);
|
|
||||||
OpenEventSpace space = _$CAPACITY_USE$IO_SARL_CORE_DEFAULTCONTEXTINTERACTIONS$CALLER.getDefaultContext().<OpenEventSpace>createSpace(OpenEventSpaceSpecification.class, UUID.randomUUID());
|
|
||||||
ctrl.setGUISpace(space);
|
|
||||||
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);
|
|
||||||
space.register(_$CAPACITY_USE$IO_SARL_CORE_BEHAVIORS$CALLER.asEventListener());
|
|
||||||
ctrl.listenAndDraw(this.grid);
|
|
||||||
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("Setup Area");
|
|
||||||
}
|
|
||||||
|
|
||||||
@SyntheticMember
|
|
||||||
@Pure
|
|
||||||
private boolean $behaviorUnitGuard$Initialize$4(final Initialize it, final Initialize occurrence) {
|
|
||||||
boolean _isEmpty = ((List<Object>)Conversions.doWrapArray(occurrence.parameters)).isEmpty();
|
|
||||||
boolean _not = (!_isEmpty);
|
|
||||||
return _not;
|
|
||||||
}
|
|
||||||
|
|
||||||
@SyntheticMember
|
|
||||||
private void $behaviorUnit$CreateArea$5(final CreateArea occurrence) {
|
|
||||||
Double x = null;
|
|
||||||
int i = 0;
|
|
||||||
Random rnd = new Random();
|
|
||||||
while ((i < (this.rocketsQuantity).intValue())) {
|
|
||||||
{
|
|
||||||
double _nextDouble = rnd.nextDouble();
|
|
||||||
double _multiply = (_nextDouble * this.maxWidth);
|
|
||||||
x = Double.valueOf(_multiply);
|
|
||||||
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(RocketLauncher.class, _$CAPACITY_USE$IO_SARL_CORE_INNERCONTEXTACCESS$CALLER.getInnerContext(), x, Double.valueOf(0.0), this.fireQuantity, this.gravity, this.grid);
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@SyntheticMember
|
|
||||||
private void $behaviorUnit$Freeze$6(final Freeze 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);
|
|
||||||
_$CAPACITY_USE$IO_SARL_CORE_INNERCONTEXTACCESS$CALLER.getInnerContext().getDefaultSpace().emit(occurrence, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
@SyntheticMember
|
|
||||||
@Pure
|
|
||||||
private boolean $behaviorUnitGuard$Freeze$6(final Freeze it, final Freeze occurrence) {
|
|
||||||
boolean _isFromMe = this.isFromMe(occurrence);
|
|
||||||
boolean _not = (!_isFromMe);
|
|
||||||
return _not;
|
|
||||||
}
|
|
||||||
|
|
||||||
@SyntheticMember
|
|
||||||
private void $behaviorUnit$MemberJoined$7(final MemberJoined 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("Area Ready");
|
|
||||||
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);
|
|
||||||
Launch _launch = new Launch();
|
|
||||||
_$CAPACITY_USE$IO_SARL_CORE_INNERCONTEXTACCESS$CALLER.getInnerContext().getDefaultSpace().emit(_launch, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
@SyntheticMember
|
|
||||||
@Pure
|
|
||||||
private boolean $behaviorUnitGuard$MemberJoined$7(final MemberJoined it, final MemberJoined 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).isInInnerDefaultSpace(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).getMemberAgentCount() == (this.rocketsQuantity).intValue()));
|
|
||||||
}
|
|
||||||
|
|
||||||
@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(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(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(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(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;
|
|
||||||
if ($behaviorUnitGuard$Initialize$3(occurrence, occurrence)) {
|
|
||||||
___SARLlocal_runnableCollection.add(() -> $behaviorUnit$Initialize$3(occurrence));
|
|
||||||
}
|
|
||||||
if ($behaviorUnitGuard$Initialize$4(occurrence, occurrence)) {
|
|
||||||
___SARLlocal_runnableCollection.add(() -> $behaviorUnit$Initialize$4(occurrence));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@SyntheticMember
|
|
||||||
@PerceptGuardEvaluator
|
|
||||||
private void $guardEvaluator$SetupSettings(final SetupSettings occurrence, final Collection<Runnable> ___SARLlocal_runnableCollection) {
|
|
||||||
assert occurrence != null;
|
|
||||||
assert ___SARLlocal_runnableCollection != null;
|
|
||||||
___SARLlocal_runnableCollection.add(() -> $behaviorUnit$SetupSettings$0(occurrence));
|
|
||||||
}
|
|
||||||
|
|
||||||
@SyntheticMember
|
|
||||||
@PerceptGuardEvaluator
|
|
||||||
private void $guardEvaluator$Freeze(final Freeze occurrence, final Collection<Runnable> ___SARLlocal_runnableCollection) {
|
|
||||||
assert occurrence != null;
|
|
||||||
assert ___SARLlocal_runnableCollection != null;
|
|
||||||
if ($behaviorUnitGuard$Freeze$6(occurrence, occurrence)) {
|
|
||||||
___SARLlocal_runnableCollection.add(() -> $behaviorUnit$Freeze$6(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$1(occurrence, occurrence)) {
|
|
||||||
___SARLlocal_runnableCollection.add(() -> $behaviorUnit$Exit$1(occurrence));
|
|
||||||
}
|
|
||||||
if ($behaviorUnitGuard$Exit$2(occurrence, occurrence)) {
|
|
||||||
___SARLlocal_runnableCollection.add(() -> $behaviorUnit$Exit$2(occurrence));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@SyntheticMember
|
|
||||||
@PerceptGuardEvaluator
|
|
||||||
private void $guardEvaluator$CreateArea(final CreateArea occurrence, final Collection<Runnable> ___SARLlocal_runnableCollection) {
|
|
||||||
assert occurrence != null;
|
|
||||||
assert ___SARLlocal_runnableCollection != null;
|
|
||||||
___SARLlocal_runnableCollection.add(() -> $behaviorUnit$CreateArea$5(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;
|
|
||||||
LaunchingArea other = (LaunchingArea) obj;
|
|
||||||
if (this.rocketsQuantity == null) {
|
|
||||||
if (other.rocketsQuantity != null)
|
|
||||||
return false;
|
|
||||||
} else if (!this.rocketsQuantity.equals(other.rocketsQuantity))
|
|
||||||
return false;
|
|
||||||
if (this.fireQuantity == null) {
|
|
||||||
if (other.fireQuantity != null)
|
|
||||||
return false;
|
|
||||||
} else if (!this.fireQuantity.equals(other.fireQuantity))
|
|
||||||
return false;
|
|
||||||
if (this.gravity == null) {
|
|
||||||
if (other.gravity != null)
|
|
||||||
return false;
|
|
||||||
} else if (!this.gravity.equals(other.gravity))
|
|
||||||
return false;
|
|
||||||
if (this.grid == null) {
|
|
||||||
if (other.grid != null)
|
|
||||||
return false;
|
|
||||||
} else if (!this.grid.equals(other.grid))
|
|
||||||
return false;
|
|
||||||
if (Double.doubleToLongBits(other.maxWidth) != Double.doubleToLongBits(this.maxWidth))
|
|
||||||
return false;
|
|
||||||
if (other.exited != this.exited)
|
|
||||||
return false;
|
|
||||||
return super.equals(obj);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@Pure
|
|
||||||
@SyntheticMember
|
|
||||||
public int hashCode() {
|
|
||||||
final int prime = 31;
|
|
||||||
int result = super.hashCode();
|
|
||||||
result = prime * result + ((this.rocketsQuantity== null) ? 0 : this.rocketsQuantity.hashCode());
|
|
||||||
result = prime * result + ((this.fireQuantity== null) ? 0 : this.fireQuantity.hashCode());
|
|
||||||
result = prime * result + ((this.gravity== null) ? 0 : this.gravity.hashCode());
|
|
||||||
result = prime * result + ((this.grid== null) ? 0 : this.grid.hashCode());
|
|
||||||
result = prime * result + (int) (Double.doubleToLongBits(this.maxWidth) ^ (Double.doubleToLongBits(this.maxWidth) >>> 32));
|
|
||||||
result = prime * result + (this.exited ? 1231 : 1237);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
@SyntheticMember
|
|
||||||
public LaunchingArea(final UUID parentID, final UUID agentID) {
|
|
||||||
super(parentID, agentID);
|
|
||||||
}
|
|
||||||
|
|
||||||
@SyntheticMember
|
|
||||||
@Inject
|
|
||||||
public LaunchingArea(final BuiltinCapacitiesProvider provider, final UUID parentID, final UUID agentID) {
|
|
||||||
super(provider, parentID, agentID);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,143 +0,0 @@
|
|||||||
package io.sarl.demos.fireworks;
|
|
||||||
|
|
||||||
import io.sarl.demos.fireworks.FirePos;
|
|
||||||
import io.sarl.demos.fireworks.RocketsPos;
|
|
||||||
import io.sarl.lang.annotation.SarlSpecification;
|
|
||||||
import io.sarl.lang.annotation.SyntheticMember;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.UUID;
|
|
||||||
import java.util.Vector;
|
|
||||||
import javafx.scene.paint.Color;
|
|
||||||
import org.eclipse.xtext.xbase.lib.Pure;
|
|
||||||
|
|
||||||
@SarlSpecification("0.5")
|
|
||||||
@SuppressWarnings("all")
|
|
||||||
public class Positions {
|
|
||||||
private HashMap<UUID, RocketsPos> rockets = new HashMap<UUID, RocketsPos>();
|
|
||||||
|
|
||||||
private HashMap<UUID, FirePos> fire = new HashMap<UUID, FirePos>();
|
|
||||||
|
|
||||||
@Pure
|
|
||||||
public Map<UUID, RocketsPos> getRockets() {
|
|
||||||
return Collections.<UUID, RocketsPos>unmodifiableMap(this.rockets);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Pure
|
|
||||||
public Map<UUID, FirePos> getFire() {
|
|
||||||
return Collections.<UUID, FirePos>unmodifiableMap(this.fire);
|
|
||||||
}
|
|
||||||
|
|
||||||
public RocketsPos setRocketPosition(final UUID id, final Vector<Double> position) {
|
|
||||||
RocketsPos _xblockexpression = null;
|
|
||||||
{
|
|
||||||
RocketsPos pos = new RocketsPos();
|
|
||||||
pos.setPosition(position);
|
|
||||||
RocketsPos _xifexpression = null;
|
|
||||||
boolean _containsKey = this.rockets.containsKey(id);
|
|
||||||
if (_containsKey) {
|
|
||||||
RocketsPos _xblockexpression_1 = null;
|
|
||||||
{
|
|
||||||
pos.setColor(this.rockets.get(id).getColor());
|
|
||||||
_xblockexpression_1 = this.rockets.replace(id, pos);
|
|
||||||
}
|
|
||||||
_xifexpression = _xblockexpression_1;
|
|
||||||
} else {
|
|
||||||
RocketsPos _xblockexpression_2 = null;
|
|
||||||
{
|
|
||||||
pos.setColor(Color.color(Math.random(), Math.random(), Math.random()));
|
|
||||||
_xblockexpression_2 = this.rockets.put(id, pos);
|
|
||||||
}
|
|
||||||
_xifexpression = _xblockexpression_2;
|
|
||||||
}
|
|
||||||
_xblockexpression = _xifexpression;
|
|
||||||
}
|
|
||||||
return _xblockexpression;
|
|
||||||
}
|
|
||||||
|
|
||||||
public RocketsPos removeRocketPosition(final UUID id) {
|
|
||||||
return this.rockets.remove(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean hideHocketPosition(final UUID id) {
|
|
||||||
return this.rockets.get(id).setHidden(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public FirePos setFirePosition(final UUID id, final UUID rocketID, final List<Vector<Double>> positions) {
|
|
||||||
FirePos _xblockexpression = null;
|
|
||||||
{
|
|
||||||
FirePos pos = new FirePos();
|
|
||||||
pos.setPositions(positions);
|
|
||||||
FirePos _xifexpression = null;
|
|
||||||
boolean _containsKey = this.fire.containsKey(id);
|
|
||||||
if (_containsKey) {
|
|
||||||
FirePos _xblockexpression_1 = null;
|
|
||||||
{
|
|
||||||
pos.setColor(this.fire.get(id).getColor());
|
|
||||||
_xblockexpression_1 = this.fire.replace(id, pos);
|
|
||||||
}
|
|
||||||
_xifexpression = _xblockexpression_1;
|
|
||||||
} else {
|
|
||||||
FirePos _xblockexpression_2 = null;
|
|
||||||
{
|
|
||||||
boolean _containsKey_1 = this.rockets.containsKey(rocketID);
|
|
||||||
if (_containsKey_1) {
|
|
||||||
pos.setColor(this.rockets.get(rocketID).getColor());
|
|
||||||
} else {
|
|
||||||
pos.setColor(Color.color(Math.random(), Math.random(), Math.random()));
|
|
||||||
}
|
|
||||||
_xblockexpression_2 = this.fire.put(id, pos);
|
|
||||||
}
|
|
||||||
_xifexpression = _xblockexpression_2;
|
|
||||||
}
|
|
||||||
_xblockexpression = _xifexpression;
|
|
||||||
}
|
|
||||||
return _xblockexpression;
|
|
||||||
}
|
|
||||||
|
|
||||||
public FirePos removeFirePosition(final UUID id) {
|
|
||||||
return this.fire.remove(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
@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;
|
|
||||||
Positions other = (Positions) obj;
|
|
||||||
if (this.rockets == null) {
|
|
||||||
if (other.rockets != null)
|
|
||||||
return false;
|
|
||||||
} else if (!this.rockets.equals(other.rockets))
|
|
||||||
return false;
|
|
||||||
if (this.fire == null) {
|
|
||||||
if (other.fire != null)
|
|
||||||
return false;
|
|
||||||
} else if (!this.fire.equals(other.fire))
|
|
||||||
return false;
|
|
||||||
return super.equals(obj);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@Pure
|
|
||||||
@SyntheticMember
|
|
||||||
public int hashCode() {
|
|
||||||
final int prime = 31;
|
|
||||||
int result = super.hashCode();
|
|
||||||
result = prime * result + ((this.rockets== null) ? 0 : this.rockets.hashCode());
|
|
||||||
result = prime * result + ((this.fire== null) ? 0 : this.fire.hashCode());
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
@SyntheticMember
|
|
||||||
public Positions() {
|
|
||||||
super();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,511 +0,0 @@
|
|||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,375 +0,0 @@
|
|||||||
package io.sarl.demos.fireworks;
|
|
||||||
|
|
||||||
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.MemberLeft;
|
|
||||||
import io.sarl.demos.fireworks.Exit;
|
|
||||||
import io.sarl.demos.fireworks.Freeze;
|
|
||||||
import io.sarl.demos.fireworks.Launch;
|
|
||||||
import io.sarl.demos.fireworks.Positions;
|
|
||||||
import io.sarl.demos.fireworks.Rocket;
|
|
||||||
import io.sarl.demos.fireworks.RocketReady;
|
|
||||||
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.UUID;
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import org.eclipse.xtext.xbase.lib.Conversions;
|
|
||||||
import org.eclipse.xtext.xbase.lib.Extension;
|
|
||||||
import org.eclipse.xtext.xbase.lib.Inline;
|
|
||||||
import org.eclipse.xtext.xbase.lib.Pure;
|
|
||||||
|
|
||||||
@SarlSpecification("0.5")
|
|
||||||
@SuppressWarnings("all")
|
|
||||||
public class RocketLauncher extends Agent {
|
|
||||||
private Double x;
|
|
||||||
|
|
||||||
private Double y;
|
|
||||||
|
|
||||||
private Integer fireQuantity;
|
|
||||||
|
|
||||||
private Double gravity;
|
|
||||||
|
|
||||||
private Positions grid;
|
|
||||||
|
|
||||||
private boolean exited = false;
|
|
||||||
|
|
||||||
@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.exited = 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$Initialize$2(final Initialize occurrence) {
|
|
||||||
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.fireQuantity = ((Integer) _get_2);
|
|
||||||
Object _get_3 = occurrence.parameters[3];
|
|
||||||
this.gravity = ((Double) _get_3);
|
|
||||||
Object _get_4 = occurrence.parameters[4];
|
|
||||||
this.grid = ((Positions) _get_4);
|
|
||||||
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 launcher created");
|
|
||||||
}
|
|
||||||
|
|
||||||
@SyntheticMember
|
|
||||||
@Pure
|
|
||||||
private boolean $behaviorUnitGuard$Initialize$2(final Initialize it, final Initialize occurrence) {
|
|
||||||
boolean _isEmpty = ((List<Object>)Conversions.doWrapArray(occurrence.parameters)).isEmpty();
|
|
||||||
boolean _not = (!_isEmpty);
|
|
||||||
return _not;
|
|
||||||
}
|
|
||||||
|
|
||||||
@SyntheticMember
|
|
||||||
private void $behaviorUnit$Initialize$3(final Initialize occurrence) {
|
|
||||||
this.x = Double.valueOf(0.0);
|
|
||||||
this.y = Double.valueOf(0.0);
|
|
||||||
this.fireQuantity = Integer.valueOf(30);
|
|
||||||
this.gravity = Double.valueOf(0.5);
|
|
||||||
this.grid = null;
|
|
||||||
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 launcher created");
|
|
||||||
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);
|
|
||||||
RocketReady _rocketReady = new RocketReady();
|
|
||||||
_$CAPACITY_USE$IO_SARL_CORE_DEFAULTCONTEXTINTERACTIONS$CALLER.emit(_rocketReady);
|
|
||||||
}
|
|
||||||
|
|
||||||
@SyntheticMember
|
|
||||||
@Pure
|
|
||||||
private boolean $behaviorUnitGuard$Initialize$3(final Initialize it, final Initialize occurrence) {
|
|
||||||
boolean _isEmpty = ((List<Object>)Conversions.doWrapArray(occurrence.parameters)).isEmpty();
|
|
||||||
return _isEmpty;
|
|
||||||
}
|
|
||||||
|
|
||||||
@SyntheticMember
|
|
||||||
private void $behaviorUnit$Launch$4(final Launch occurrence) {
|
|
||||||
double _random = Math.random();
|
|
||||||
double vx = (_random * 2.0);
|
|
||||||
double _random_1 = Math.random();
|
|
||||||
double _multiply = (_random_1 * 5.5);
|
|
||||||
double vy = (_multiply + 2.0);
|
|
||||||
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(Rocket.class, _$CAPACITY_USE$IO_SARL_CORE_INNERCONTEXTACCESS$CALLER.getInnerContext(), this.x, this.y, Double.valueOf(vx), Double.valueOf(vy), this.gravity, this.fireQuantity, this.grid);
|
|
||||||
}
|
|
||||||
|
|
||||||
@SyntheticMember
|
|
||||||
private void $behaviorUnit$Freeze$5(final Freeze 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);
|
|
||||||
_$CAPACITY_USE$IO_SARL_CORE_INNERCONTEXTACCESS$CALLER.getInnerContext().getDefaultSpace().emit(occurrence, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
@SyntheticMember
|
|
||||||
@Pure
|
|
||||||
private boolean $behaviorUnitGuard$Freeze$5(final Freeze it, final Freeze occurrence) {
|
|
||||||
boolean _isFromMe = this.isFromMe(occurrence);
|
|
||||||
boolean _not = (!_isFromMe);
|
|
||||||
return _not;
|
|
||||||
}
|
|
||||||
|
|
||||||
@SyntheticMember
|
|
||||||
private void $behaviorUnit$MemberLeft$6(final MemberLeft occurrence) {
|
|
||||||
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);
|
|
||||||
Launch _launch = new Launch();
|
|
||||||
_$CAPACITY_USE$IO_SARL_CORE_BEHAVIORS$CALLER.wake(_launch);
|
|
||||||
}
|
|
||||||
|
|
||||||
@SyntheticMember
|
|
||||||
@Pure
|
|
||||||
private boolean $behaviorUnitGuard$MemberLeft$6(final MemberLeft it, final MemberLeft occurrence) {
|
|
||||||
return ((!this.isFromMe(occurrence)) && (!this.exited));
|
|
||||||
}
|
|
||||||
|
|
||||||
@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(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(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(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;
|
|
||||||
if ($behaviorUnitGuard$Initialize$2(occurrence, occurrence)) {
|
|
||||||
___SARLlocal_runnableCollection.add(() -> $behaviorUnit$Initialize$2(occurrence));
|
|
||||||
}
|
|
||||||
if ($behaviorUnitGuard$Initialize$3(occurrence, occurrence)) {
|
|
||||||
___SARLlocal_runnableCollection.add(() -> $behaviorUnit$Initialize$3(occurrence));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@SyntheticMember
|
|
||||||
@PerceptGuardEvaluator
|
|
||||||
private void $guardEvaluator$Freeze(final Freeze occurrence, final Collection<Runnable> ___SARLlocal_runnableCollection) {
|
|
||||||
assert occurrence != null;
|
|
||||||
assert ___SARLlocal_runnableCollection != null;
|
|
||||||
if ($behaviorUnitGuard$Freeze$5(occurrence, occurrence)) {
|
|
||||||
___SARLlocal_runnableCollection.add(() -> $behaviorUnit$Freeze$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$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$Launch(final Launch occurrence, final Collection<Runnable> ___SARLlocal_runnableCollection) {
|
|
||||||
assert occurrence != null;
|
|
||||||
assert ___SARLlocal_runnableCollection != null;
|
|
||||||
___SARLlocal_runnableCollection.add(() -> $behaviorUnit$Launch$4(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;
|
|
||||||
RocketLauncher other = (RocketLauncher) 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.fireQuantity == null) {
|
|
||||||
if (other.fireQuantity != null)
|
|
||||||
return false;
|
|
||||||
} else if (!this.fireQuantity.equals(other.fireQuantity))
|
|
||||||
return false;
|
|
||||||
if (this.gravity == null) {
|
|
||||||
if (other.gravity != null)
|
|
||||||
return false;
|
|
||||||
} else if (!this.gravity.equals(other.gravity))
|
|
||||||
return false;
|
|
||||||
if (this.grid == null) {
|
|
||||||
if (other.grid != null)
|
|
||||||
return false;
|
|
||||||
} else if (!this.grid.equals(other.grid))
|
|
||||||
return false;
|
|
||||||
if (other.exited != this.exited)
|
|
||||||
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.fireQuantity== null) ? 0 : this.fireQuantity.hashCode());
|
|
||||||
result = prime * result + ((this.gravity== null) ? 0 : this.gravity.hashCode());
|
|
||||||
result = prime * result + ((this.grid== null) ? 0 : this.grid.hashCode());
|
|
||||||
result = prime * result + (this.exited ? 1231 : 1237);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
@SyntheticMember
|
|
||||||
public RocketLauncher(final UUID parentID, final UUID agentID) {
|
|
||||||
super(parentID, agentID);
|
|
||||||
}
|
|
||||||
|
|
||||||
@SyntheticMember
|
|
||||||
@Inject
|
|
||||||
public RocketLauncher(final BuiltinCapacitiesProvider provider, final UUID parentID, final UUID agentID) {
|
|
||||||
super(provider, parentID, agentID);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,23 +0,0 @@
|
|||||||
package io.sarl.demos.fireworks;
|
|
||||||
|
|
||||||
import io.sarl.lang.annotation.SarlSpecification;
|
|
||||||
import io.sarl.lang.annotation.SyntheticMember;
|
|
||||||
import io.sarl.lang.core.Address;
|
|
||||||
import io.sarl.lang.core.Event;
|
|
||||||
|
|
||||||
@SarlSpecification("0.5")
|
|
||||||
@SuppressWarnings("all")
|
|
||||||
public class RocketReady extends Event {
|
|
||||||
@SyntheticMember
|
|
||||||
public RocketReady() {
|
|
||||||
super();
|
|
||||||
}
|
|
||||||
|
|
||||||
@SyntheticMember
|
|
||||||
public RocketReady(final Address source) {
|
|
||||||
super(source);
|
|
||||||
}
|
|
||||||
|
|
||||||
@SyntheticMember
|
|
||||||
private final static long serialVersionUID = 588368462L;
|
|
||||||
}
|
|
@ -1,92 +0,0 @@
|
|||||||
package io.sarl.demos.fireworks;
|
|
||||||
|
|
||||||
import io.sarl.lang.annotation.SarlSpecification;
|
|
||||||
import io.sarl.lang.annotation.SyntheticMember;
|
|
||||||
import java.util.Vector;
|
|
||||||
import javafx.scene.paint.Color;
|
|
||||||
import org.eclipse.xtext.xbase.lib.Pure;
|
|
||||||
|
|
||||||
@SarlSpecification("0.5")
|
|
||||||
@SuppressWarnings("all")
|
|
||||||
public class RocketsPos {
|
|
||||||
public final int ROCKETREFRESHDELAY = 100;
|
|
||||||
|
|
||||||
private Vector<Double> position = new Vector<Double>();
|
|
||||||
|
|
||||||
private Color color;
|
|
||||||
|
|
||||||
private boolean hidden = false;
|
|
||||||
|
|
||||||
@Pure
|
|
||||||
public Vector<Double> getPosition() {
|
|
||||||
return this.position;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Vector<Double> setPosition(final Vector<Double> position) {
|
|
||||||
return this.position = position;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Pure
|
|
||||||
public Color getColor() {
|
|
||||||
return this.color;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Color setColor(final Color color) {
|
|
||||||
return this.color = color;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean setHidden(final boolean hidden) {
|
|
||||||
return this.hidden = hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Pure
|
|
||||||
public boolean getHidden() {
|
|
||||||
return this.hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
@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;
|
|
||||||
RocketsPos other = (RocketsPos) obj;
|
|
||||||
if (other.ROCKETREFRESHDELAY != this.ROCKETREFRESHDELAY)
|
|
||||||
return false;
|
|
||||||
if (this.position == null) {
|
|
||||||
if (other.position != null)
|
|
||||||
return false;
|
|
||||||
} else if (!this.position.equals(other.position))
|
|
||||||
return false;
|
|
||||||
if (this.color == null) {
|
|
||||||
if (other.color != null)
|
|
||||||
return false;
|
|
||||||
} else if (!this.color.equals(other.color))
|
|
||||||
return false;
|
|
||||||
if (other.hidden != this.hidden)
|
|
||||||
return false;
|
|
||||||
return super.equals(obj);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@Pure
|
|
||||||
@SyntheticMember
|
|
||||||
public int hashCode() {
|
|
||||||
final int prime = 31;
|
|
||||||
int result = super.hashCode();
|
|
||||||
result = prime * result + this.ROCKETREFRESHDELAY;
|
|
||||||
result = prime * result + ((this.position== null) ? 0 : this.position.hashCode());
|
|
||||||
result = prime * result + ((this.color== null) ? 0 : this.color.hashCode());
|
|
||||||
result = prime * result + (this.hidden ? 1231 : 1237);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
@SyntheticMember
|
|
||||||
public RocketsPos() {
|
|
||||||
super();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,89 +0,0 @@
|
|||||||
package io.sarl.demos.fireworks;
|
|
||||||
|
|
||||||
import io.sarl.lang.annotation.SarlSpecification;
|
|
||||||
import io.sarl.lang.annotation.SyntheticMember;
|
|
||||||
import io.sarl.lang.core.Event;
|
|
||||||
import org.eclipse.xtext.xbase.lib.Pure;
|
|
||||||
|
|
||||||
@SarlSpecification("0.5")
|
|
||||||
@SuppressWarnings("all")
|
|
||||||
public class SetupSettings extends Event {
|
|
||||||
public Integer rocketsQuantity;
|
|
||||||
|
|
||||||
public Integer fireQuatity;
|
|
||||||
|
|
||||||
public Double gravity;
|
|
||||||
|
|
||||||
public Double maxWidth;
|
|
||||||
|
|
||||||
public SetupSettings(final Integer rq, final Integer fq, final Double grav, final Double max) {
|
|
||||||
this.rocketsQuantity = rq;
|
|
||||||
this.fireQuatity = fq;
|
|
||||||
this.gravity = grav;
|
|
||||||
this.maxWidth = max;
|
|
||||||
}
|
|
||||||
|
|
||||||
@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;
|
|
||||||
SetupSettings other = (SetupSettings) obj;
|
|
||||||
if (this.rocketsQuantity == null) {
|
|
||||||
if (other.rocketsQuantity != null)
|
|
||||||
return false;
|
|
||||||
} else if (!this.rocketsQuantity.equals(other.rocketsQuantity))
|
|
||||||
return false;
|
|
||||||
if (this.fireQuatity == null) {
|
|
||||||
if (other.fireQuatity != null)
|
|
||||||
return false;
|
|
||||||
} else if (!this.fireQuatity.equals(other.fireQuatity))
|
|
||||||
return false;
|
|
||||||
if (this.gravity == null) {
|
|
||||||
if (other.gravity != null)
|
|
||||||
return false;
|
|
||||||
} else if (!this.gravity.equals(other.gravity))
|
|
||||||
return false;
|
|
||||||
if (this.maxWidth == null) {
|
|
||||||
if (other.maxWidth != null)
|
|
||||||
return false;
|
|
||||||
} else if (!this.maxWidth.equals(other.maxWidth))
|
|
||||||
return false;
|
|
||||||
return super.equals(obj);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@Pure
|
|
||||||
@SyntheticMember
|
|
||||||
public int hashCode() {
|
|
||||||
final int prime = 31;
|
|
||||||
int result = super.hashCode();
|
|
||||||
result = prime * result + ((this.rocketsQuantity== null) ? 0 : this.rocketsQuantity.hashCode());
|
|
||||||
result = prime * result + ((this.fireQuatity== null) ? 0 : this.fireQuatity.hashCode());
|
|
||||||
result = prime * result + ((this.gravity== null) ? 0 : this.gravity.hashCode());
|
|
||||||
result = prime * result + ((this.maxWidth== null) ? 0 : this.maxWidth.hashCode());
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a String representation of the SetupSettings event's attributes only.
|
|
||||||
*/
|
|
||||||
@SyntheticMember
|
|
||||||
@Pure
|
|
||||||
protected String attributesToString() {
|
|
||||||
StringBuilder result = new StringBuilder(super.attributesToString());
|
|
||||||
result.append("rocketsQuantity = ").append(this.rocketsQuantity);
|
|
||||||
result.append("fireQuatity = ").append(this.fireQuatity);
|
|
||||||
result.append("gravity = ").append(this.gravity);
|
|
||||||
result.append("maxWidth = ").append(this.maxWidth);
|
|
||||||
return result.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
@SyntheticMember
|
|
||||||
private final static long serialVersionUID = 354887804L;
|
|
||||||
}
|
|
@ -1,23 +0,0 @@
|
|||||||
package io.sarl.demos.fireworks;
|
|
||||||
|
|
||||||
import io.sarl.lang.annotation.SarlSpecification;
|
|
||||||
import io.sarl.lang.annotation.SyntheticMember;
|
|
||||||
import io.sarl.lang.core.Address;
|
|
||||||
import io.sarl.lang.core.Event;
|
|
||||||
|
|
||||||
@SarlSpecification("0.5")
|
|
||||||
@SuppressWarnings("all")
|
|
||||||
public class SprayFire extends Event {
|
|
||||||
@SyntheticMember
|
|
||||||
public SprayFire() {
|
|
||||||
super();
|
|
||||||
}
|
|
||||||
|
|
||||||
@SyntheticMember
|
|
||||||
public SprayFire(final Address source) {
|
|
||||||
super(source);
|
|
||||||
}
|
|
||||||
|
|
||||||
@SyntheticMember
|
|
||||||
private final static long serialVersionUID = 588368462L;
|
|
||||||
}
|
|
@ -1,23 +0,0 @@
|
|||||||
package io.sarl.demos.fireworks;
|
|
||||||
|
|
||||||
import io.sarl.lang.annotation.SarlSpecification;
|
|
||||||
import io.sarl.lang.annotation.SyntheticMember;
|
|
||||||
import io.sarl.lang.core.Address;
|
|
||||||
import io.sarl.lang.core.Event;
|
|
||||||
|
|
||||||
@SarlSpecification("0.5")
|
|
||||||
@SuppressWarnings("all")
|
|
||||||
public class UpdateFirePosition extends Event {
|
|
||||||
@SyntheticMember
|
|
||||||
public UpdateFirePosition() {
|
|
||||||
super();
|
|
||||||
}
|
|
||||||
|
|
||||||
@SyntheticMember
|
|
||||||
public UpdateFirePosition(final Address source) {
|
|
||||||
super(source);
|
|
||||||
}
|
|
||||||
|
|
||||||
@SyntheticMember
|
|
||||||
private final static long serialVersionUID = 588368462L;
|
|
||||||
}
|
|
@ -1,23 +0,0 @@
|
|||||||
package io.sarl.demos.fireworks;
|
|
||||||
|
|
||||||
import io.sarl.lang.annotation.SarlSpecification;
|
|
||||||
import io.sarl.lang.annotation.SyntheticMember;
|
|
||||||
import io.sarl.lang.core.Address;
|
|
||||||
import io.sarl.lang.core.Event;
|
|
||||||
|
|
||||||
@SarlSpecification("0.5")
|
|
||||||
@SuppressWarnings("all")
|
|
||||||
public class UpdateRocketPosition extends Event {
|
|
||||||
@SyntheticMember
|
|
||||||
public UpdateRocketPosition() {
|
|
||||||
super();
|
|
||||||
}
|
|
||||||
|
|
||||||
@SyntheticMember
|
|
||||||
public UpdateRocketPosition(final Address source) {
|
|
||||||
super(source);
|
|
||||||
}
|
|
||||||
|
|
||||||
@SyntheticMember
|
|
||||||
private final static long serialVersionUID = 588368462L;
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user