public void SaveToFrm(Stream stream, FrmModel model) { try { var data = FrmConverter.ConvertToData(model); FrmParser.SaveTo(stream, data); } catch (Exception e) { throw new Exception("Exception occured when saving model as FRM.", e); } }
public FrmModel LoadFromFrm(Stream stream) { try { var frmData = FrmParser.LoadFrom(stream); var frmModel = FrmConverter.ConvertToModel(frmData, _palette); return(frmModel); } catch (Exception e) { throw new Exception("Exception occured when loading model from FRM representation.", e); } }