Ejemplo n.º 1
0
        public async Task <CodeBin> GetCodeBin(bool edited = false)
        {
            var path = this.ExeFS;

            if (edited && this.IsOverridingOutPath)
            {
                var editedPath = Path.Combine(this.OutputPathOverride, "ExeFS");

                if (Directory.GetFiles(editedPath, "*code.bin").Length > 0)
                {
                    path = editedPath;
                }
            }

            var filename = Directory.GetFiles(path, "*code.bin").FirstOrDefault();

            if (filename == null)
            {
                throw new FileNotFoundException("Could not find code binary file");
            }

            var codeBin = new CodeBin(filename);

            await codeBin.Load();

            return(codeBin);
        }
Ejemplo n.º 2
0
        internal void SaveTmsHms(TmsHms tmsHms, CodeBin codeBin)
        {
            Assertions.AssertVersion(this.Version, tmsHms.GameVersion);

            codeBin.WriteStructure(tmsHms);
        }