コード例 #1
0
ファイル: Program.cs プロジェクト: austinvaness/AttackDrone
        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;
        }
コード例 #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();
        }
コード例 #3
0
 void ResetMovement()
 {
     gyros.Reset();
     thrust.Reset();
 }