renamed Info to LegacyInfo, marked Obsolete. added NewUnitInfo ref as Info.

This commit is contained in:
Chris Forbes
2010-01-10 18:28:24 +13:00
parent 74a2ed9624
commit 99a61ca8d9
52 changed files with 142 additions and 137 deletions

View File

@@ -29,7 +29,7 @@ namespace OpenRa.Game.Traits
public Building(Actor self)
{
this.self = self;
unitInfo = (LegacyBuildingInfo)self.Info;
unitInfo = (LegacyBuildingInfo)self.LegacyInfo;
self.CenterLocation = Game.CellSize
* ((float2)self.Location + .5f * (float2)unitInfo.Dimensions);
}
@@ -84,8 +84,8 @@ namespace OpenRa.Game.Traits
if (remainingTicks == 0)
{
var costPerHp = (Rules.General.URepairPercent * self.Info.Cost) / self.Info.Strength;
var hpToRepair = Math.Min(Rules.General.URepairStep, self.Info.Strength - self.Health);
var costPerHp = (Rules.General.URepairPercent * self.LegacyInfo.Cost) / self.LegacyInfo.Strength;
var hpToRepair = Math.Min(Rules.General.URepairStep, self.LegacyInfo.Strength - self.Health);
var cost = (int)Math.Ceiling(costPerHp * hpToRepair);
if (!self.Owner.TakeCash(cost))
{
@@ -95,7 +95,7 @@ namespace OpenRa.Game.Traits
Game.world.AddFrameEndTask(w => w.Add(new RepairIndicator(self)));
self.InflictDamage(self, -hpToRepair, Rules.WarheadInfo["Super"]);
if (self.Health == self.Info.Strength)
if (self.Health == self.LegacyInfo.Strength)
{
isRepairing = false;
return;