public FlowFieldFollower(FlowFieldPlugIn plugin) : base(plugin.Annotations) { _plugin = plugin; _proximityToken = plugin.Database.AllocateToken(this); }
public FlowFieldFollower(FlowFieldPlugIn plugin) : base(plugin.Annotations) { _plugin = plugin; _proximityToken = plugin.Database.AllocateToken(this); }
public Missile(IProximityDatabase <IVehicle> proximity, IVehicle target, IAnnotationService annotation) : base(annotation) { _trail = new Trail(1, 10) { TrailColor = Color.Red, TickColor = Color.DarkRed }; _proximityToken = proximity.AllocateToken(this); Target = target; }
public Missile(IProximityDatabase<IVehicle> proximity, IVehicle target, IAnnotationService annotation) :base(annotation) { _trail = new Trail(1, 10) { TrailColor = Color.Red, TickColor = Color.DarkRed }; _proximityToken = proximity.AllocateToken(this); Target = target; }
// constructor public Boid(IProximityDatabase<IVehicle> pd, IAnnotationService annotations = null) :base(annotations) { // allocate a token for this boid in the proximity database _proximityToken = null; NewPD(pd); _trail = new Trail(2f, 60); // reset all boid state Reset(); }
public Fighter(IProximityDatabase <IVehicle> proximity, IAnnotationService annotation, Action <Fighter, Fighter> fireMissile) : base(annotation) { _trail = new Trail(5, 50) { TrailColor = Color.WhiteSmoke, TickColor = Color.LightGray }; _proximityToken = proximity.AllocateToken(this); _fireMissile = fireMissile; }
// constructor public Boid(IProximityDatabase <IVehicle> pd, IAnnotationService annotations = null) : base(annotations) { // allocate a token for this boid in the proximity database _proximityToken = null; NewPD(pd); _trail = new Trail(2f, 60); // reset all boid state Reset(); }
// switch to new proximity database -- just for demo purposes public void NewPD(IProximityDatabase <IVehicle> pd) { // delete this boid's token in the old proximity database if (_proximityToken != null) { _proximityToken.Dispose(); _proximityToken = null; } // allocate a token for this boid in the proximity database _proximityToken = pd.AllocateToken(this); }
public Fighter(IProximityDatabase<IVehicle> proximity, IAnnotationService annotation, Action<Fighter, Fighter> fireMissile) :base(annotation) { _trail = new Trail(5, 50) { TrailColor = Color.WhiteSmoke, TickColor = Color.LightGray }; _proximityToken = proximity.AllocateToken(this); _fireMissile = fireMissile; }
public void Update(float currentTime, float elapsedTime) { _timer -= elapsedTime; if (!IsDead) { _trail.Record(currentTime, Position); ApplySteeringForce(SteerForPursuit(Target, 1) * 0.95f + SteerForWander(elapsedTime) * 0.05f, elapsedTime); _proximityToken.UpdateForNewPosition(Position); } else if (_proximityToken != null) { _proximityToken.Dispose(); _proximityToken = null; } }
public void Update(float currentTime, float elapsedTime) { _timer -= elapsedTime; if (!IsDead) { _trail.Record(currentTime, Position); ApplySteeringForce(SteerForPursuit(Target, 1) * 0.95f + SteerForWander(elapsedTime) * 0.05f, elapsedTime); _proximityToken.UpdateForNewPosition(Position); } else if (_proximityToken != null) { _proximityToken.Dispose(); _proximityToken = null; } }
//========================================================================================================================= public void Init(int side, FVector2 pos, float rotation) { this.Side = side; this.Position = pos; IntObj3D = new InteractiveObject3D(this); ForegroundGame.IntObjs3D.Add(IntObj3D); IntObj2D = ForegroundGame.IntObjsManager.Add(this); proximityToken = BackgroundGame.IntObjsLQDB.AllocateToken(this); proximityToken.UpdateForNewPosition(new Point3D(pos.X.ToInt(), 0, pos.Y.ToInt())); onInitialize(); Initialized = true; }
// switch to new proximity database -- just for demo purposes public void NewPD(IProximityDatabase<IVehicle> pd) { // delete this boid's token in the old proximity database if (_proximityToken != null) { _proximityToken.Dispose(); _proximityToken = null; } // allocate a token for this boid in the proximity database _proximityToken = pd.AllocateToken(this); }