public override void WaitForConditionUpdate(FrameOperationContext fop, WorldObjectProximityCondition condition)
        {
            if (condition.WorldObjectReferences == null &&
                condition.Range == null)
            {
                return;
            }

            var state = new ConditionState()
            {
                InstanceIds           = condition.WorldObjectReferences.Select(r => fop.GetInstanceId(r.ObjectId)).ToArray(),
                FrameOperationContext = fop,
                Condition             = condition
            };

            m_waitingConditions[fop.GetInstanceId(condition.Id)] = state;

            base.WaitForConditionUpdate(fop, condition);
        }
Beispiel #2
0
        public override bool CheckState(FrameOperationContext fop, CanCompleteTaskCondition condition, out object[] results)
        {
            results = null;

            if (condition.TaskReference != null)
            {
                var instanceId = fop.GetInstanceId(condition.TaskReference.ObjectId);

                var driver = TaskManager.Instance.GetDriver(instanceId);

                return(TaskManager.Instance.CanComplete(driver));
            }

            return(false);
        }
        public override bool CheckState(FrameOperationContext fop, WorldObjectProximityCondition condition, out object[] results)
        {
            results = null;

            if (condition.WorldObjectReferences == null ||
                condition.Range == null)
            {
                return(false);
            }

            foreach (var objRef in condition.WorldObjectReferences)
            {
                var instIds = condition.WorldObjectReferences.Select(o => fop.GetInstanceId(o.ObjectId));

                return(CheckCondition(instIds, fop, condition, out results));
            }

            return(false);
        }
        public override void StopWaiting(FrameOperationContext fop, WorldObjectProximityCondition condition)
        {
            m_waitingConditions.Remove(fop.GetInstanceId(condition.Id));

            base.StopWaiting(fop, condition);
        }