Beispiel #1
0
        public ContextRobot()
        {
            Steps = 8;
            Sensors.Add(SensorBullets   = new SensorBullets(this));
            Sensors.Add(SensorFleets    = new SensorFleets(this));
            Sensors.Add(SensorTeam      = new SensorTeam(this));
            Sensors.Add(SensorAllies    = new SensorAllies(this));
            Sensors.Add(SensorFish      = new SensorFish(this));
            Sensors.Add(SensorAbandoned = new SensorAbandoned(this));

            ContextRingBlending = new ContextRingBlendingWeighted(this);
        }
Beispiel #2
0
        public bool IsSafeShot(float angle)
        {
            var safeSet = Safe
                ? SensorFleets.Others
                : SensorFleets.Others.Where(f => SensorAllies.IsAlly(f));

            if (this.SensorFleets.MyFleet != null)
            {
                if (safeSet
                    .Any(f => RoboMath.MightHit(
                             this.HookComputer,
                             this.SensorFleets.MyFleet,
                             f,
                             angle)))
                {
                    return(false);
                }
            }

            return(true);
        }