Esempio n. 1
0
        public Stack <Maneuver> GetManeuvers(Tick tick)
        {
            Maneuver lastManeuverAtTick = GetLastManeuverAtTick(tick);

            if (lastManeuverAtTick == null)
            {
                return(null);
            }
            Tick startTick = lastManeuverAtTick.GetStartTick();

            maneuverStack.Clear();
            for (int i = 0; i < maneuvers.Count; i++)
            {
                Maneuver maneuver = maneuvers[i];
                if (maneuver.GetStartTick() == startTick)
                {
                    maneuverStack.Push(maneuver);
                }
            }
            return(maneuverStack);
        }
Esempio n. 2
0
        private bool NewManeuverEliminatesExistingManeuver(Maneuver existingManeuver, Maneuver newManeuver)
        {
            switch (existingManeuver.GetStartTick() >= newManeuver.GetStartTick())
            {
            case false:
                return(false);

            case true:
                switch (existingManeuver.IsExclusive + newManeuver.IsExclusive)
                {
                case 2:
                    return(true);

                case 1:
                    return(false);

                case 0:
                    return(existingManeuver.GetType() == newManeuver.GetType());
                }
                break;
            }
            //Debug.LogError("We should never get here.");
            return(true);
        }