Stylecop clean Editor

This commit is contained in:
Matthias Mailänder
2013-08-07 13:49:48 +02:00
parent 57f7f71c8d
commit 2dbc4f4786
17 changed files with 897 additions and 974 deletions

View File

@@ -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;