public HardCodedTranslationProvider(TmodFileWrapper.ITmodFile modFile, ModuleDef module, GameCultures lang)
        {
            _modFile = modFile;
            _module  = module ?? throw new ArgumentNullException(nameof(module));
            _lang    = lang;

            _logger = LogManager.GetLogger(GetType().Name);

            LoadTypeDefinitions();
            CreateInitializationMethod();
        }
        protected ProcessEngine(string modPath, string sourcePath, GameCultures language)
        {
            ModPath    = modPath;
            SourcePath = sourcePath;
            Language   = language;

            var wrapper = new TmodFileWrapper(typeof(BitsByte).Assembly);

            Mod = wrapper.LoadFile(ModPath);

            Processors = new List <Type>();
            SetupProcessors((IList <Type>)Processors);
        }
        protected Processor(TmodFileWrapper.ITmodFile modFile, ModuleDef modModule, GameCultures culture)
        {
            ModFile   = modFile ?? throw new ArgumentNullException(nameof(modFile));
            ModModule = modModule ?? throw new ArgumentNullException(nameof(modModule));

            Logger = LogManager.GetLogger("Proc." + GetType().Name);

            InstructionSelectors = new Dictionary <string, MethodInfo>();

            Provider = new HardCodedTranslationProvider(modFile, modModule, culture);

            InitializeInstructionSelectors();
        }
        public Localizer(string modPath, string srcPath = null, RunningMode mode = RunningMode.Dump,
                         GameCultures lang = GameCultures.English)
        {
            if (string.IsNullOrEmpty(modPath) || !File.Exists(modPath))
            {
                throw new ArgumentException("Invalid mod path given.", nameof(modPath));
            }

            if (mode == RunningMode.Patch && !Directory.Exists(srcPath))
            {
                throw new ArgumentException("Invalid source path given.", nameof(srcPath));
            }

            ModPath = modPath;
            LocalizationSourcePath = srcPath;
            Mode     = mode;
            Language = lang;
        }
 public TileProcessor(TmodFileWrapper.ITmodFile modFile, ModuleDef modModule, GameCultures culture) : base(modFile, modModule, culture)
 {
 }
示例#6
0
 public DumpEngine(string modPath, string sourcePath, GameCultures language) : base(modPath, sourcePath, language)
 {
     _module = AssemblyDef.Load(Mod.GetMainAssembly()).Modules.Single();
 }
 public PatchEngine(string modPath, string sourcePath, GameCultures language) : base(modPath, sourcePath, language)
 {
 }