1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- 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;
- }
- }
|