protected override void AdjustMotion(IMoveable movingObject, InterpolatedVector motion) { var speed = motion.Current; speed = speed.SetDegrees(AngleInDegrees).SetLength(DistancePerSecond); motion.X.Current = speed.X; motion.Y.Current = speed.Y; }
protected override void AdjustMotion(IMoveable movingObject, InterpolatedVector motion) { if (!setStart) { setStart = true; motion.GetAxis(Config.Axis).Current = Config.GetStartSpeed(movingObject); } motion.GetAxis(Config.Axis).SetTarget(Config.GetTargetSpeed(movingObject), Config.Change.Value); }
protected override void AdjustMotion(IMoveable movingObject, InterpolatedVector motion) { if (!Motion.Active) { Brake.Update(movingObject, motion); } else { Motion.Update(movingObject, motion); } }
public void Update(IMoveable movingObject, InterpolatedVector motion) { if (Condition.IsActiveAndNotNull()) { if (!wasActive) { OnActivated(); } wasActive = true; AdjustMotion(movingObject, motion); } else { wasActive = false; } }
public InterpolatedVector Apply(InterpolatedVector v) { if (Condition.IsActive) { var ret = new InterpolatedVector(); ret.X.Current = v.X.Current; ret.X.SetTarget(v.X.Target * TargetMod.Value, v.X.ChangePerSecond * DeltaMod.Value); ret.Y.Current = v.Y.Current; ret.Y.SetTarget(v.Y.Target * TargetMod.Value, v.Y.ChangePerSecond * DeltaMod.Value); return(ret); } else { return(v); } }
protected override void AdjustMotion(IMoveable movingObject, InterpolatedVector motion) { motion.X.Current = Config.MotionPerSecond.X; motion.Y.Current = Config.MotionPerSecond.Y; }
protected abstract void AdjustMotion(IMoveable movingObject, InterpolatedVector motion);