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; }
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(); }
void ResetMovement() { gyros.Reset(); thrust.Reset(); }