using System; using System.IO; namespace PrivateMaidMode { public class PrivateMaid { public Maid Maid { get { return this.m_privateMaid; } } public DataBase.BG BG { get { return this.m_privateBG; } } public DataBase.BG.Location Location { get { return this.m_privateLocation; } } public void SetPrivateMaid(Maid maid) { this.m_privateMaid = maid; if (maid != null) { this.m_maidGUID = maid.status.guid; } else { this.m_maidGUID = string.Empty; } } public void SetPrivateBG(DataBase.BG bg) { this.m_privateBG = bg; this.m_uniqueNameBG = bg.uniqueName; } public void SetPrivateLocation(DataBase.BG.Location location) { this.m_privateLocation = location; if (location != null) { this.m_locationName = location.drawName; } } public void Serialize(BinaryWriter bw) { bw.Write(this.m_maidGUID); bw.Write(this.m_uniqueNameBG); bw.Write(this.m_locationName); } public void Deserialize(BinaryReader br) { this.m_maidGUID = br.ReadString(); this.m_privateMaid = GameMain.Instance.CharacterMgr.GetStockMaid(this.m_maidGUID); this.m_uniqueNameBG = br.ReadString(); this.m_privateBG = DataBase.GetBGData(this.m_uniqueNameBG); this.m_locationName = br.ReadString(); if (this.m_locationName != null && this.m_locationName != string.Empty) { this.m_privateLocation = this.m_privateBG.GetLocation(this.m_locationName); } } private string m_maidGUID = string.Empty; private Maid m_privateMaid; private string m_uniqueNameBG = string.Empty; private DataBase.BG m_privateBG; private string m_locationName = string.Empty; private DataBase.BG.Location m_privateLocation; } }