private int Inc(ObjectStatus.RelativeSpeed speed, int posoneg, int location) { int inc; switch (speed) { case (ObjectStatus.RelativeSpeed.Fast): inc = 2; break; case ObjectStatus.RelativeSpeed.Slow: inc = 1; break; case ObjectStatus.RelativeSpeed.Stopped: default: return(location); } if (posoneg > 0) { return(location + inc); } if (posoneg < 0) { return(location - inc); } return(location); }
public bool Next(ObjectStatus.RelativeSpeed speed, out ScreenCell2D next) { next = this.here; if (next.Equals(there)) { return(true); } course.XPos = this.there.XPos - this.here.XPos; course.YPos = this.there.YPos - this.here.YPos; switch (rnd.Next(1, 3)) { case 1: next.XPos = Inc(speed, course.XPos, next.XPos); break; case 2: next.YPos = Inc(speed, course.YPos, next.YPos); break; case 3: next.XPos = Inc(speed, course.XPos, next.XPos); next.YPos = Inc(speed, course.YPos, next.YPos); break; } return(false); }
public static void Set(Noun noun, ObjectStatus.RelativeSpeed speed) { noun.speed = speed; }
public void DoDeInit() { this.state = ObjectStatus.ActiveState.Dead; this.speed = ObjectStatus.RelativeSpeed.Stopped; }
virtual public void DoInit() { state = ObjectStatus.ActiveState.Alive; speed = ObjectStatus.RelativeSpeed.Slow; }