private void AddCommand(SceneAddCommandInfo command) { var obj = Info.Objects[command.Object]; IHandlerObject handler = null; if (obj is HandlerSpriteInfo) { handler = new HandlerSprite(((HandlerSpriteInfo)obj).Sprite, new Point(command.X, command.Y)); } else if (obj is MeterInfo) { handler = new HandlerMeter(HealthMeter.Create((MeterInfo)obj, false), this); } handler.Start(); var name = command.Name ?? Guid.NewGuid().ToString(); if (!objects.ContainsKey(name)) { objects.Add(name, handler); } }
private void AddCommand(SceneAddCommandInfo command) { var obj = Info.Objects[command.Object]; IHandlerObject handler = null; if (obj is HandlerSpriteInfo) { handler = new HandlerSprite(((HandlerSpriteInfo)obj).Sprite, new Point(command.X, command.Y)); } else if (obj is MeterInfo) { handler = new HandlerMeter(HealthMeter.Create((MeterInfo)obj, false), this); } handler.Start(); var name = command.Name ?? Guid.NewGuid().ToString(); if (!objects.ContainsKey(name)) objects.Add(name, handler); }