private void MoveCommand(SceneMoveCommandInfo command) { HandlerSprite obj = objects[command.Name] as HandlerSprite; if (obj != null) { obj.Move(command.X, command.Y, command.Duration); obj.Reset(); } }
public static SceneMoveCommandInfo LoadMoveCommand(XElement node) { var info = new SceneMoveCommandInfo(); info.Name = node.RequireAttribute("name").Value; info.Duration = node.TryAttribute <int>("duration"); info.X = node.GetAttribute <int>("x"); info.Y = node.GetAttribute <int>("y"); return(info); }