sight moved to Unit/Building

This commit is contained in:
Chris Forbes
2010-01-11 18:37:35 +13:00
parent 50b138e2de
commit 4b19f1dfe5
7 changed files with 83 additions and 192 deletions

View File

@@ -33,7 +33,7 @@ namespace OpenRa.Game
public void Explore(Actor a)
{
foreach (var t in Game.FindTilesInCircle((1f / Game.CellSize * a.CenterLocation).ToInt2(), a.LegacyInfo.Sight))
foreach (var t in Game.FindTilesInCircle((1f / Game.CellSize * a.CenterLocation).ToInt2(), a.Info.Traits.Get<OwnedActorInfo>().Sight))
explored[t.X, t.Y] = true;
dirty = true;

View File

@@ -15,6 +15,7 @@ namespace OpenRa.Game.Traits
public readonly ArmorType Armor = ArmorType.none;
public readonly bool Crewed = false; // replace with trait?
public readonly int InitialFacing = 128;
public readonly int Sight = 0;
}
class BuildingInfo : OwnedActorInfo, ITraitInfo

View File

@@ -7,7 +7,6 @@ namespace OpenRa.Game.Traits
{
class MobileInfo : ITraitInfo
{
public readonly int Sight = 0;
public readonly int ROT = 0;
public readonly int Speed = 0;