Fix IDE0032
This commit is contained in:
committed by
Pavel Penev
parent
9809f6ed08
commit
ed90322a0b
@@ -42,16 +42,12 @@ namespace OpenRA.Mods.Common.Traits
|
||||
readonly Dictionary<Actor, int> powerDrain = new();
|
||||
|
||||
[Sync]
|
||||
int totalProvided;
|
||||
|
||||
public int PowerProvided => totalProvided;
|
||||
public int PowerProvided { get; private set; }
|
||||
|
||||
[Sync]
|
||||
int totalDrained;
|
||||
public int PowerDrained { get; private set; }
|
||||
|
||||
public int PowerDrained => totalDrained;
|
||||
|
||||
public int ExcessPower => totalProvided - totalDrained;
|
||||
public int ExcessPower => PowerProvided - PowerDrained;
|
||||
|
||||
public int PowerOutageRemainingTicks { get; private set; }
|
||||
public int PowerOutageTotalTicks { get; private set; }
|
||||
@@ -96,14 +92,14 @@ namespace OpenRA.Mods.Common.Traits
|
||||
return;
|
||||
|
||||
if (old > 0)
|
||||
totalProvided -= old;
|
||||
PowerProvided -= old;
|
||||
else if (old < 0)
|
||||
totalDrained += old;
|
||||
PowerDrained += old;
|
||||
|
||||
if (amount > 0)
|
||||
totalProvided += amount;
|
||||
PowerProvided += amount;
|
||||
else if (amount < 0)
|
||||
totalDrained -= amount;
|
||||
PowerDrained -= amount;
|
||||
|
||||
UpdatePowerState();
|
||||
}
|
||||
@@ -122,9 +118,9 @@ namespace OpenRA.Mods.Common.Traits
|
||||
return;
|
||||
|
||||
if (amount > 0)
|
||||
totalProvided -= amount;
|
||||
PowerProvided -= amount;
|
||||
else if (amount < 0)
|
||||
totalDrained += amount;
|
||||
PowerDrained += amount;
|
||||
|
||||
UpdatePowerState();
|
||||
}
|
||||
@@ -147,17 +143,17 @@ namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
if (wasHackEnabled != devMode.UnlimitedPower)
|
||||
{
|
||||
totalProvided = 0;
|
||||
totalDrained = 0;
|
||||
PowerProvided = 0;
|
||||
PowerDrained = 0;
|
||||
|
||||
if (!devMode.UnlimitedPower)
|
||||
{
|
||||
foreach (var kv in powerDrain)
|
||||
{
|
||||
if (kv.Value > 0)
|
||||
totalProvided += kv.Value;
|
||||
PowerProvided += kv.Value;
|
||||
else if (kv.Value < 0)
|
||||
totalDrained -= kv.Value;
|
||||
PowerDrained -= kv.Value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user