StyleCop clean OpenRA.Mods.RA

This commit is contained in:
Matthias Mailänder
2015-01-04 16:49:45 +01:00
parent 2691f16a81
commit 1b0e3a7a7f
39 changed files with 414 additions and 398 deletions

View File

@@ -30,35 +30,35 @@ namespace OpenRA.Mods.RA
class CashTrickler : ITick, ISync, INotifyCapture
{
readonly CashTricklerInfo info;
[Sync] int ticks;
CashTricklerInfo Info;
public CashTrickler(CashTricklerInfo info)
{
Info = info;
this.info = info;
}
public void Tick(Actor self)
{
if (--ticks < 0)
{
ticks = Info.Period;
self.Owner.PlayerActor.Trait<PlayerResources>().GiveCash(Info.Amount);
MaybeAddCashTick(self, Info.Amount);
ticks = info.Period;
self.Owner.PlayerActor.Trait<PlayerResources>().GiveCash(info.Amount);
MaybeAddCashTick(self, info.Amount);
}
}
public void OnCapture(Actor self, Actor captor, Player oldOwner, Player newOwner)
{
if (Info.CaptureAmount > 0)
if (info.CaptureAmount > 0)
{
newOwner.PlayerActor.Trait<PlayerResources>().GiveCash(Info.CaptureAmount);
MaybeAddCashTick(self, Info.CaptureAmount);
newOwner.PlayerActor.Trait<PlayerResources>().GiveCash(info.CaptureAmount);
MaybeAddCashTick(self, info.CaptureAmount);
}
}
void MaybeAddCashTick(Actor self, int amount)
{
if (Info.ShowTicks)
if (info.ShowTicks)
self.World.AddFrameEndTask(w => w.Add(new FloatingText(self.CenterPosition, self.Owner.Color.RGB, FloatingText.FormatCashTick(amount), 30)));
}
}