Ejemplo n.º 1
0
        void Detect()
        {
            if (wcTurrets != null)
            {
                threatsTemp.Clear();
                wcTurrets.GetSortedThreats(Me, threatsTemp);
                if (threatsTemp.Count > 0)
                {
                    SetEnemy(threatsTemp.Keys.First());
                    return;
                }
            }
            else if (turrets.Count == 0)
            {
                thrust.Reset();
                gyros.Reset();
                throw new Exception("No turrets remain for detection.");
            }

            foreach (IMyLargeTurretBase t in turrets)
            {
                if (t.HasTarget)
                {
                    SetEnemy(t.GetTargetedEntity());
                    return;
                }
            }
            detected = false;
        }
Ejemplo n.º 2
0
        void Stop()
        {
            if (recordingPath != null)
            {
                recordingPath.UpdateStatus(Path.Mode.None);
                recordingPath = null;
            }

            if (currentPaths.Count > 0)
            {
                Path current = paths [currentPaths.Peek()];
                current.UpdateStatus(Path.Mode.None);
                currentPaths.Clear();
            }

            thrust.Reset();
            gyros.Reset();
        }
Ejemplo n.º 3
0
 void ResetMovement()
 {
     gyros.Reset();
     thrust.Reset();
 }