public Repeat(uint times, BehaviorComponent behavior) : base(behavior) { this.times = times; }
/// <summary> /// executes the behavior after a given amount of time in miliseconds has passed /// </summary> /// <param name="elapsedTimeFunction">function that returns elapsed time</param> /// <param name="timeToWait">maximum time to wait before executing behavior</param> /// <param name="behavior">behavior to run</param> /*public Timer(TimerDelegate elapsedTimeFunction, long timeToWait, BehaviorComponent behavior) * { * _ElapsedTimeFunction = elapsedTimeFunction; * _Behavior = behavior; * _WaitTime = timeToWait; * }*/ public Timer(float timeToWait, BehaviorComponent behavior) : base(behavior) { _WaitTime = timeToWait; stopwatch = new Stopwatch(); }
/// <summary> /// Returns Suceess no matter what /// </summary> /// <param name="behavior"></param> public Succeeder(BehaviorComponent behavior) : base(behavior) { }
/// <summary> /// inverts the given behavior /// -Returns Success on Failure or Error /// -Returns Failure on Success /// -Returns Running on Running /// </summary> /// <param name="behavior"></param> public Inverter(BehaviorComponent behavior) : base(behavior) { }
/// <summary> /// randomly executes the behavior /// </summary> /// <param name="probability">probability of execution</param> /// <param name="randomFunction">function that determines probability to execute</param> /// <param name="behavior">behavior to execute</param> public RandomDecorator(float probability, Func <float> randomFunction, BehaviorComponent behavior) : base(behavior) { _Probability = probability; _RandomFunction = randomFunction; }
public RunForSeconds(float timeToRun, BehaviorComponent behavior) : base(behavior) { _WaitTime = timeToRun; stopwatch = new Stopwatch(); }
public UntilFail(BehaviorComponent behavior) : base(behavior) { }
/// <summary> /// executes the behavior based on a counter /// -each time Counter is called the counter increments by 1 /// -Counter executes the behavior when it reaches the supplied maxCount /// </summary> /// <param name="maxCount">max number to count to</param> /// <param name="behavior">behavior to run</param> public Counter(int maxCount, BehaviorComponent behavior) : base(behavior) { _MaxCount = maxCount; }
public Decorator(BehaviorComponent behavior) { this._Behavior = behavior; }