slim down the ore capacity update
This commit is contained in:
@@ -112,10 +112,7 @@ namespace OpenRA
|
|||||||
GiveAdvice(World.WorldActor.Info.Traits.Get<EvaAlertsInfo>().LowPower);
|
GiveAdvice(World.WorldActor.Info.Traits.Get<EvaAlertsInfo>().LowPower);
|
||||||
}
|
}
|
||||||
|
|
||||||
public float GetSiloFullness()
|
public float GetSiloFullness() { return (float)Ore / OreCapacity; }
|
||||||
{
|
|
||||||
return (float)Ore / OreCapacity;
|
|
||||||
}
|
|
||||||
|
|
||||||
public PowerState GetPowerState()
|
public PowerState GetPowerState()
|
||||||
{
|
{
|
||||||
@@ -124,14 +121,6 @@ namespace OpenRA
|
|||||||
return PowerState.Critical;
|
return PowerState.Critical;
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateOreCapacity()
|
|
||||||
{
|
|
||||||
OreCapacity = World.Queries.OwnedBy[this]
|
|
||||||
.Where(a => a.traits.Contains<StoresOre>())
|
|
||||||
.Select(a => a.Info.Traits.Get<StoresOreInfo>())
|
|
||||||
.Sum(b => b.Capacity);
|
|
||||||
}
|
|
||||||
|
|
||||||
void GiveAdvice(string advice)
|
void GiveAdvice(string advice)
|
||||||
{
|
{
|
||||||
// todo: store the condition or something.
|
// todo: store the condition or something.
|
||||||
@@ -172,7 +161,9 @@ namespace OpenRA
|
|||||||
public void Tick()
|
public void Tick()
|
||||||
{
|
{
|
||||||
UpdatePower();
|
UpdatePower();
|
||||||
UpdateOreCapacity();
|
|
||||||
|
OreCapacity = World.Queries.OwnedBy[this].WithTrait<StoresOre>()
|
||||||
|
.Sum(a => a.Actor.Info.Traits.Get<StoresOreInfo>().Capacity);
|
||||||
|
|
||||||
var totalMoney = Cash + Ore;
|
var totalMoney = Cash + Ore;
|
||||||
var diff = Math.Abs(totalMoney - DisplayCash);
|
var diff = Math.Abs(totalMoney - DisplayCash);
|
||||||
|
|||||||
Reference in New Issue
Block a user