示例#1
0
        public void CheckConditions()
        {
            if (mCheckingConditions)
            {
                return;
            }

            mCheckingConditions = true;
            MissionStatesCondition topCondition = null;
            int topConditionIndex = 0;

            if (MissionCondition.CheckConditions <MissionStatesCondition> (State.Conditions, out topConditionIndex))
            {
                topCondition = State.Conditions [topConditionIndex];
                if (topCondition.RemoveFromGame)
                {
                    worlditem.SetMode(WIMode.RemovedFromGame);
                }
                else
                {
                    if (topCondition.ExistingState == worlditem.State)
                    {
                        worlditem.State = topCondition.StateVariable;
                    }
                }
            }

            mCheckingConditions = false;
        }
        public MissionInteriorCondition GetTopCondition()
        {
            int topConditionIndex = 0;
            MissionInteriorCondition topCondition = null;

            if (MissionCondition.CheckConditions <MissionInteriorCondition>(State.Conditions, out topConditionIndex))
            {
                topCondition = State.Conditions[topConditionIndex];
            }
            else
            {
                topCondition = State.Default;
            }
            return(topCondition);
        }