Stylecop clean Editor
This commit is contained in:
@@ -17,12 +17,12 @@ namespace OpenRA.Editor
|
||||
{
|
||||
class ActorTool : ITool
|
||||
{
|
||||
ActorTemplate Actor;
|
||||
public ActorTool(ActorTemplate actor) { this.Actor = actor; }
|
||||
ActorTemplate actorTemplate;
|
||||
public ActorTool(ActorTemplate actor) { this.actorTemplate = actor; }
|
||||
|
||||
public void Preview(Surface surface, SGraphics g)
|
||||
{
|
||||
surface.DrawActor(g, surface.GetBrushLocation(), Actor,
|
||||
surface.DrawActor(g, surface.GetBrushLocation(), actorTemplate,
|
||||
surface.GetPaletteForPlayer(surface.NewActorOwner));
|
||||
}
|
||||
|
||||
@@ -33,17 +33,17 @@ namespace OpenRA.Editor
|
||||
|
||||
var owner = surface.NewActorOwner;
|
||||
var id = NextActorName(surface);
|
||||
surface.Map.Actors.Value[id] = new ActorReference(Actor.Info.Name.ToLowerInvariant())
|
||||
surface.Map.Actors.Value[id] = new ActorReference(actorTemplate.Info.Name.ToLowerInvariant())
|
||||
{
|
||||
new LocationInit( surface.GetBrushLocation() ),
|
||||
new OwnerInit( owner)
|
||||
new LocationInit(surface.GetBrushLocation()),
|
||||
new OwnerInit(owner)
|
||||
};
|
||||
}
|
||||
|
||||
string NextActorName(Surface surface)
|
||||
{
|
||||
var id = 0;
|
||||
for (; ; )
|
||||
for (;;)
|
||||
{
|
||||
var possible = "Actor{0}".F(id++);
|
||||
if (!surface.Map.Actors.Value.ContainsKey(possible)) return possible;
|
||||
|
||||
Reference in New Issue
Block a user