public static Map Import(string filename, string mod, Ruleset rules, Action <string> errorHandler) { var map = new LegacyMapImporter(filename, rules, errorHandler).map; map.RequiresMod = mod; map.FixOpenAreas(rules); return(map); }
public void Run(ModData modData, string[] args) { // HACK: The engine code assumes that Game.modData is set. Game.modData = modData; var rules = Game.modData.RulesetCache.LoadDefaultRules(); var map = LegacyMapImporter.Import(args[1], modData.Manifest.Mod.Id, rules, e => Console.WriteLine(e)); var dest = map.Title + ".oramap"; map.Save(dest); Console.WriteLine(dest + " saved."); }
public void Run(ModData modData, string[] args) { // HACK: The engine code assumes that Game.modData is set. Game.ModData = modData; var rules = Game.ModData.RulesetCache.Load(); var map = LegacyMapImporter.Import(args[1], modData.Manifest.Mod.Id, rules, Console.WriteLine); var fileName = Path.GetFileNameWithoutExtension(args[1]); var dest = fileName + ".oramap"; map.Save(dest); Console.WriteLine(dest + " saved."); }
public static Map Import(string filename, string mod, Ruleset rules, Action<string> errorHandler) { var map = new LegacyMapImporter(filename, rules, errorHandler).map; map.RequiresMod = mod; map.FixOpenAreas(rules); return map; }