finished TraitDictionary. Refactored permanent actor-removal.
This commit is contained in:
@@ -31,8 +31,8 @@ namespace OpenRA
|
||||
public Player Owner;
|
||||
|
||||
IActivity currentActivity;
|
||||
public Group Group;
|
||||
|
||||
public Group Group;
|
||||
|
||||
internal Actor(World world, string name, TypeDictionary initDict )
|
||||
{
|
||||
var init = new ActorInitializer( this, initDict );
|
||||
@@ -69,7 +69,7 @@ namespace OpenRA
|
||||
}
|
||||
|
||||
public void Tick()
|
||||
{
|
||||
{
|
||||
var wasIdle = currentActivity is Idle;
|
||||
while (currentActivity != null)
|
||||
{
|
||||
@@ -142,7 +142,7 @@ namespace OpenRA
|
||||
return new RectangleF(loc.X, loc.Y, size.X, size.Y);
|
||||
}
|
||||
|
||||
public bool IsInWorld { get; set; }
|
||||
public bool IsInWorld { get; internal set; }
|
||||
|
||||
public void QueueActivity( IActivity nextActivity )
|
||||
{
|
||||
@@ -209,7 +209,17 @@ namespace OpenRA
|
||||
|
||||
public void AddTrait( object trait )
|
||||
{
|
||||
World.traitDict.Add( this, trait );
|
||||
World.traitDict.AddTrait( this, trait );
|
||||
}
|
||||
|
||||
public void Destroy()
|
||||
{
|
||||
World.AddFrameEndTask( w => World.Remove( this ) );
|
||||
}
|
||||
|
||||
~Actor()
|
||||
{
|
||||
World.traitDict.RemoveActor( this );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user