Ejemplo n.º 1
0
 private OperationsManager()
 {
     NumberMissiles = MAX_MISSILES;
     // Set up access to all needed objects
     _target_manager = TargetManager.GetInstance();
     _turret = new MissileLauncherAdapter();
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Operations Manager constructor.  
 /// </summary>
 private OperationsManager()
 {
     NumberMissiles = MAX_MISSILES;
     // Set up access to all needed objects
     _target_manager = TargetManager.GetInstance();
     _turret = new MissileLauncherAdapter();
     _target_manager.TargetAdded += on_targets_changed;
     // this manual reset event helps synchronize between threads.
     _wait_event = new ManualResetEvent(false);
     _lock = new Object();
     //_seach_mode_list.Add(0, "Idle");
     //_seach_mode_list.Add(1, "Foes");
     //_seach_mode_list.Add(2, "Friends");
     //_seach_mode_list.Add(3, "All");
 }
Ejemplo n.º 3
0
 /// <summary>
 /// actualy disposal method
 /// </summary>
 /// <param name="dispose_others"></param>
 protected virtual void Dispose(bool dispose_others)
 {
     if (dispose_others == true)
     {
         this._targets.Clear();
         this._targets = null;
         _instance = null;
     }
 }
Ejemplo n.º 4
0
 /// <summary>
 ///  returns insance of TargetManager
 /// </summary>
 /// <returns></returns>
 public static TargetManager GetInstance()
 {
     if (_instance == null)
     {
         _instance = new TargetManager();
     }
     return _instance;
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Operations Manager constructor.  
 /// </summary>
 private OperationsManager()
 {
     NumberMissiles = MAX_MISSILES;
     // Set up access to all needed objects
     _target_manager = TargetManager.GetInstance();
     _turret = new MissileLauncherAdapter();
     _target_manager.TargetAdded += on_targets_changed;
     _lock = new Object();
     /* we need a way to make these search modes more plug-n-play*/
     _search_modes = new List<string>();
     _search_modes.Add("Foes");
     _search_modes.Add("Friends");
     _search_modes.Add("All");
     _search_mode = new searchfoe();
     _bw = new BackgroundWorker();
     _bw.WorkerSupportsCancellation = true;
     _td = new TargetDetector();
     _td.ImageProcessed += new EventHandler(on_targets_detected);
     _timer = new ThreadedTimer.Timer();
     _timer.TimeCaptured += new EventHandler<TimerEventArgs>(_timer_TimeCaptured);
     TurretReset();
     _visual_target = false;
 }