/// <summary> /// Only to be called by the RpgCharacterSerializer /// </summary> public XpPacket ExportSerializationPacket() { XpPacket newPacket = new XpPacket(); newPacket.xpProgessorId = this.xpProgressorId.GuidString; newPacket.level = this.level; newPacket.xp = this.xp; newPacket.xpToNextLevel = this.xpToNextLevel; newPacket.currentLevelMultiplier = this.currentLevelMultiplier; newPacket.currentOldValueMultiplier = this.currentOldValueMultiplier; return(newPacket); }
/// <summary> /// Deserialization constructor /// </summary> public XpData(XpPacket xpDataPacket) { Debug.Assert(xpDataPacket != null, "XpData's constructor is being given a null XpPacket!"); this.xpProgressorId = new SaveableGuid(xpDataPacket.xpProgessorId); this.xpProgressor = RpgDataRegistry.Instance.SearchXpProgressor(this.xpProgressorId.GuidData); Debug.Assert(this.xpProgressor != null, "Deserializaing XpData failed because the XpProgressor was not found! ID: " + xpDataPacket.xpProgessorId); this.level = xpDataPacket.level; this.xp = xpDataPacket.xp; this.xpToNextLevel = xpDataPacket.xpToNextLevel; this.currentLevelMultiplier = xpDataPacket.currentLevelMultiplier; this.currentOldValueMultiplier = xpDataPacket.currentOldValueMultiplier; }