コード例 #1
0
 private bool IsItemOutdated(GobTrackerItem item)
 {
     if (item.Gob.Dead || item.Gob.IsDisposed) return true;
     if (item.TrackerGob != null)
     {
         if (item.TrackerGob.Dead || item.TrackerGob.IsDisposed) return true;
     }
     return false;
 }
コード例 #2
0
ファイル: Rocket.cs プロジェクト: vvnurmi/assaultwing
 private void CreateGobTrackers()
 {
     if (_targetTracker != null) throw new ApplicationException("Rocket is creating a gob tracker although it has one already");
     if (Target == null) return;
     _targetTracker = new GobTrackerItem(Target, this, "gui_tracker_rockettarget")
     {
         StickToBorders = false,
         ShowWhileTargetOnScreen = true,
     };
     if (PlayerOwner != null) PlayerOwner.GobTrackerItems.Add(_targetTracker);
     var targetPlayerOwner = Target.Owner as Player;
     if (targetPlayerOwner != null) targetPlayerOwner.GobTrackerItems.Add(_targetTracker);
 }
コード例 #3
0
ファイル: Rocket.cs プロジェクト: vvnurmi/assaultwing
 private void RemoveGobTrackers()
 {
     if (_targetTracker == null) return;
     if (PlayerOwner != null) PlayerOwner.GobTrackerItems.Remove(_targetTracker);
     if (_targetTracker.Gob != null)
     {
         var targetPlayerOwner = _targetTracker.Gob.Owner as Player;
         if (targetPlayerOwner != null) targetPlayerOwner.GobTrackerItems.Remove(_targetTracker);
     }
     _targetTracker = null;
 }
コード例 #4
0
ファイル: Arena.cs プロジェクト: vvnurmi/assaultwing
 private void AddGobTrackerToViewports(Gob gob, string textureName)
 {
     var trackerItem = new GobTrackerItem(gob, null, textureName);
     foreach (var plr in Game.DataEngine.Players)
         if (plr.IsLocal) plr.GobTrackerItems.Add(trackerItem);
 }