public void Write(DirectoryInfo dir, GamePath originalPath) { var data = Data switch { EqdpFile eqdp => eqdp.WriteBytes(), EqpFile eqp => eqp.WriteBytes(), GmpFile gmp => gmp.WriteBytes(), EstFile est => est.WriteBytes(), ImcFile imc => imc.WriteBytes(), CmpFile cmp => cmp.WriteBytes(), _ => throw new NotImplementedException(), }; DisposeFile(CurrentFile); CurrentFile = TempFile.WriteNew(dir, data, $"_{originalPath.Filename()}"); Changed = false; }