Use Tuple syntax

This commit is contained in:
teinarss
2020-08-02 13:41:03 +02:00
committed by Paul Chote
parent 8a74f6ea18
commit 19b02875c7
90 changed files with 738 additions and 826 deletions

View File

@@ -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; }