Import() public static method

public static Import ( string filename, string mod, string tileset, Ruleset rules ) : Map
filename string
mod string
tileset string
rules Ruleset
return Map
        void IUtilityCommand.Run(Utility utility, string[] args)
        {
            // HACK: The engine code assumes that Game.modData is set.
            Game.ModData = utility.ModData;

            var rules = Ruleset.LoadDefaultsForTileSet(utility.ModData, "ARRAKIS");
            var map   = D2kMapImporter.Import(args[1], utility.ModData.Manifest.Id, args[2], rules);

            if (map == null)
            {
                return;
            }

            var dest = Path.GetFileNameWithoutExtension(args[1]) + ".oramap";

            map.Save(ZipFile.Create(dest, new Folder(".")));
            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 = Ruleset.LoadDefaultsForTileSet(modData, "ARRAKIS");
            var map   = D2kMapImporter.Import(args[1], modData.Manifest.Mod.Id, args[2], rules);

            if (map == null)
            {
                return;
            }

            var dest    = Path.GetFileNameWithoutExtension(args[1]) + ".oramap";
            var package = new ZipFile(modData.DefaultFileSystem, dest, true);

            map.Save(package);
            Console.WriteLine(dest + " saved.");
        }
示例#3
0
        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 = D2kMapImporter.Import(args[1], modData.Manifest.Mod.Id, args[2], rules);

            if (map == null)
            {
                return;
            }

            var fileName = Path.GetFileNameWithoutExtension(args[1]);
            var dest     = fileName + ".oramap";

            map.Save(dest);
            Console.WriteLine(dest + " saved.");
        }