コード例 #1
0
        public static ACar[] GetCarPath(Car self, Moves stack)
        {
            if (stack == null)
            {
                return(null);
            }

            stack = stack.Clone();
            var res   = new List <ACar>();
            var model = new ACar(self);

            while (stack.Count > 0)
            {
                var m = stack[0];
                AMove.ModelMove(model, m, new PassedInfo(), Bonuses, OilSlicks, Tires, Others);
                m.Times--;
                stack.Normalize();
                res.Add(model.Clone());
            }
            return(res.ToArray());
        }
コード例 #2
0
        private void _validateLastSuccessStack()
        {
            if (_lastSuccessStack == null)
            {
                return;
            }
            var car   = new ACar(Self);
            var stack = _lastSuccessStack.Clone();
            var info  = new PassedInfo();

            while (stack.Count > 0)
            {
                if (!AMove.ModelMove(car, stack[0], info,
                                     new ABonus[] {}, new AOilSlick[] {}, new AProjectile[][] {}, new ACar[][] {}))
                {
                    _lastSuccessStack = null;
                    return;
                }
                stack[0].Times--;
                stack.Normalize();
            }
        }
コード例 #3
0
 public bool _modelMove(ACar car, AMove m, PassedInfo total)
 {
     return(AMove.ModelMove(car, m, total,
                            _bonusCandidates, _slickCandidates, _projCandidates, _carCandidates));
 }