Use Tuple syntax
This commit is contained in:
@@ -26,7 +26,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
class CapturableProgressBar : ConditionalTrait<CapturableProgressBarInfo>, ISelectionBar, ICaptureProgressWatcher
|
||||
{
|
||||
Dictionary<Actor, Pair<int, int>> progress = new Dictionary<Actor, Pair<int, int>>();
|
||||
Dictionary<Actor, (int Current, int Total)> progress = new Dictionary<Actor, (int, int)>();
|
||||
|
||||
public CapturableProgressBar(Actor self, CapturableProgressBarInfo info)
|
||||
: base(info) { }
|
||||
@@ -39,7 +39,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
if (total == 0)
|
||||
progress.Remove(captor);
|
||||
else
|
||||
progress[captor] = Pair.New(current, total);
|
||||
progress[captor] = (current, total);
|
||||
}
|
||||
|
||||
float ISelectionBar.GetValue()
|
||||
@@ -47,7 +47,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
if (IsTraitDisabled || !progress.Any())
|
||||
return 0f;
|
||||
|
||||
return progress.Values.Max(p => (float)p.First / p.Second);
|
||||
return progress.Values.Max(p => (float)p.Current / p.Total);
|
||||
}
|
||||
|
||||
Color ISelectionBar.GetColor() { return Info.Color; }
|
||||
|
||||
Reference in New Issue
Block a user