changes to TypeDictionary's interface. (build-palette is broken, so hasn't been tested)

This commit is contained in:
Bob
2010-01-12 13:27:59 +13:00
parent e6e5275f05
commit 5a29dd6ee2
36 changed files with 96 additions and 74 deletions

View File

@@ -16,8 +16,8 @@ namespace OpenRa.Game
for (int i = 0; i < 128; i++)
for (int j = 0; j < 128; j++)
influence[ i, j ] = new List<Actor>();
Game.world.ActorRemoved += a => Remove(a, a.traits.WithInterface<IOccupySpace>().FirstOrDefault());
Game.world.ActorRemoved += a => Remove( a, a.traits.GetOrDefault<IOccupySpace>() );
}
public void Tick()
@@ -53,7 +53,7 @@ namespace OpenRa.Game
for( int x = 0 ; x < 128 ; x++ )
if( influence[ x, y ] != null )
foreach (var a in influence[ x, y ])
if (!a.traits.WithInterface<IOccupySpace>().First().OccupiedCells().Contains( new int2( x, y ) ) )
if (!a.traits.Get<IOccupySpace>().OccupiedCells().Contains( new int2( x, y ) ) )
throw new InvalidOperationException( "UIM: Sanity check failed A" );
foreach( Actor a in Game.world.Actors )