Пример #1
0
        public override void DeSerialize(DeSerializationContext context)
        {
            base.DeSerialize(context);

            Missions = new SingleMission[context.ReadByte()];
            for (int i = 0; i < Missions.Length; ++i)
            {
                Missions[i] = new SingleMission(context);
            }

            int l = context.ReadByte();

            Teams = new Team[l];
            for (int i = 0; i < l; ++i)
            {
                Teams[i] = CreateTeam();
                Teams[i].DeSerialize(context);
                Teams[i].Index = i;
            }
        }
Пример #2
0
        public override void Tick(float dtime)
        {
            base.Tick(dtime);

            if (!Root.Instance.IsAuthoritive)
            {
                return;
            }

            for (int i = 0; i < Missions.Length; ++i)
            {
                SingleMission m       = Missions[i];
                Status        current = m.CurrentStatus;
                m.Tick(dtime, this);
                if (m.CurrentStatus == Status.Done && current != Status.Done)
                {
                    MissionCompleted(i);
                }
            }
        }
Пример #3
0
        protected override void TimeLimitHit()
        {
            base.TimeLimitHit();
            for (int i = 0; i < Missions.Length; ++i)
            {
                SingleMission sm = Missions[i];
                foreach (Objective o in sm.PrimaryObjectives)
                {
                    EscortObjective es = o as EscortObjective;
                    if (es != null)
                    {
                        es.NoTreats = true;
                    }
                }

                /*sm.Tick(0.001f);
                 * if (sm.CurrentStatus == Status.Done)
                 * {
                 *  MissionCompleted(i);
                 * }*/
            }
        }
Пример #4
0
        public override void DeSerialize(DeSerializationContext context)
        {
            base.DeSerialize(context);

            Missions = new SingleMission[context.ReadByte()];
            for (int i = 0; i < Missions.Length; ++i)
            {
                Missions[i] = new SingleMission(context);
            }

            int l = context.ReadByte();
            Teams = new Team[l];
            for (int i = 0; i < l; ++i)
            {
                Teams[i] = CreateTeam();
                Teams[i].DeSerialize(context);
                Teams[i].Index = i;
            }
        }