Esempio n. 1
0
        public override void ThinkAboutActions()
        {
            // OK, we're a positional dweller. Do we want to move?
            IPercent percent = Random.NextPercent();

            if (percent.Value < ProbabilityOfMoving.Percent.Value)
            {
                // do we have any movement actions?
                if (!_dweller.ActionManager.ContainsActionType(ActionType.Move))
                {
                    AddMovementAction(
                        Random.NextDouble() * (Bounds.Value.X - 50.0),
                        Random.NextDouble() * (Bounds.Value.Y - 50.0)
                        );
                }
            }
        }
        public IEnumerator Run(IPercent process, float newDuration = -1f)
        {
            if (newDuration > 0f)
            {
                duration = newDuration;
            }

            startTime = Time.time;

            while (inProgress && !interruptFlag)
            {
                process.percent = percent;
                yield return(null);
            }

            process.percent = 1f;
            interruptFlag   = false;
        }
Esempio n. 3
0
 public ActionBase(IThought initiatingThought, ActionType actionType, IPercent priority) : base(actionType.ToString())
 {
     InitiatingThought = initiatingThought;
     ActionType        = actionType;
     Priority          = priority;
 }
Esempio n. 4
0
 public void SetPriority(PriorityType pt, IPercent percent)
 {
     GetPriority(pt).Percent.Value = percent.Value;
 }