BIM/UIM become traits on World; Added World.WorldActor

This commit is contained in:
Bob
2010-01-29 19:57:21 +13:00
parent 7283bc5273
commit 206e4fb558
21 changed files with 73 additions and 64 deletions

View File

@@ -17,8 +17,8 @@ namespace OpenRa
public static bool IsCellBuildable(this World world, int2 a, UnitMovementType umt, Actor toIgnore)
{
if (world.BuildingInfluence.GetBuildingAt(a) != null) return false;
if (world.UnitInfluence.GetUnitsAt(a).Any(b => b != toIgnore)) return false;
if (world.WorldActor.traits.Get<BuildingInfluence>().GetBuildingAt(a) != null) return false;
if (world.WorldActor.traits.Get<UnitInfluence>().GetUnitsAt(a).Any(b => b != toIgnore)) return false;
return world.Map.IsInMap(a.X, a.Y) &&
TerrainCosts.Cost(umt,
@@ -130,7 +130,7 @@ namespace OpenRa
{
for( int x = scanStart.X ; x < scanEnd.X ; x++ )
{
var at = world.BuildingInfluence.GetBuildingAt( new int2( x, y ) );
var at = world.WorldActor.traits.Get<BuildingInfluence>().GetBuildingAt( new int2( x, y ) );
if( at != null && at.Owner == p )
nearnessCandidates.Add( new int2( x, y ) );
}