mirror of
https://github.com/SoDOff-Project/sodoff.git
synced 2025-10-11 08:18:49 -07:00
mission deep copy
.net 8 deprecated BinaryFormatter serialization apart from that proper deep copies are ~10x faster
This commit is contained in:
parent
3ffced2b60
commit
dc303d871e
@ -4,9 +4,28 @@ namespace sodoff.Schema;
|
|||||||
|
|
||||||
[XmlRoot(ElementName = "AR", Namespace = "")]
|
[XmlRoot(ElementName = "AR", Namespace = "")]
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class AchievementReward
|
public class AchievementReward {
|
||||||
{
|
public AchievementReward() {}
|
||||||
[XmlElement(ElementName = "ui", IsNullable = true)]
|
|
||||||
|
public AchievementReward(AchievementReward other) {
|
||||||
|
if (other.UserItem != null)
|
||||||
|
UserItem = new UserItemData(other.UserItem);
|
||||||
|
|
||||||
|
Amount = other.Amount;
|
||||||
|
PointTypeID = other.PointTypeID;
|
||||||
|
ItemID = other.ItemID;
|
||||||
|
EntityID = other.EntityID;
|
||||||
|
EntityTypeID = other.EntityTypeID;
|
||||||
|
RewardID = other.RewardID;
|
||||||
|
AchievementID = other.AchievementID;
|
||||||
|
AllowMultiple = other.AllowMultiple;
|
||||||
|
MinAmount = other.MinAmount;
|
||||||
|
MaxAmount = other.MaxAmount;
|
||||||
|
Date = other.Date;
|
||||||
|
CommonInventoryID = other.CommonInventoryID;
|
||||||
|
}
|
||||||
|
|
||||||
|
[XmlElement(ElementName = "ui", IsNullable = true)]
|
||||||
public UserItemData UserItem { get; set; }
|
public UserItemData UserItem { get; set; }
|
||||||
|
|
||||||
[XmlElement(ElementName = "a")]
|
[XmlElement(ElementName = "a")]
|
||||||
|
@ -5,9 +5,16 @@ namespace sodoff.Schema;
|
|||||||
|
|
||||||
[XmlRoot(ElementName = "BP", Namespace = "", IsNullable = true)]
|
[XmlRoot(ElementName = "BP", Namespace = "", IsNullable = true)]
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class BluePrint
|
public class BluePrint {
|
||||||
{
|
public BluePrint() {}
|
||||||
[XmlElement(ElementName = "BPDC", IsNullable = true)]
|
|
||||||
|
public BluePrint(BluePrint other) {
|
||||||
|
Deductibles = other.Deductibles.Select(d => new BluePrintDeductibleConfig(d)).ToList();
|
||||||
|
Ingredients = other.Ingredients.Select(i => new BluePrintSpecification(i)).ToList();
|
||||||
|
Outputs = other.Outputs.Select(o => new BluePrintSpecification(o)).ToList();
|
||||||
|
}
|
||||||
|
|
||||||
|
[XmlElement(ElementName = "BPDC", IsNullable = true)]
|
||||||
public List<BluePrintDeductibleConfig> Deductibles { get; set; }
|
public List<BluePrintDeductibleConfig> Deductibles { get; set; }
|
||||||
|
|
||||||
[XmlElement(ElementName = "ING", IsNullable = false)]
|
[XmlElement(ElementName = "ING", IsNullable = false)]
|
||||||
|
@ -4,9 +4,17 @@ namespace sodoff.Schema;
|
|||||||
|
|
||||||
[XmlRoot(ElementName = "BPDC", Namespace = "", IsNullable = true)]
|
[XmlRoot(ElementName = "BPDC", Namespace = "", IsNullable = true)]
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class BluePrintDeductibleConfig
|
public class BluePrintDeductibleConfig {
|
||||||
{
|
public BluePrintDeductibleConfig() {}
|
||||||
[XmlElement(ElementName = "BPIID", IsNullable = false)]
|
|
||||||
|
public BluePrintDeductibleConfig(BluePrintDeductibleConfig other) {
|
||||||
|
BluePrintItemID = other.BluePrintItemID;
|
||||||
|
DeductibleType = other.DeductibleType;
|
||||||
|
ItemID = other.ItemID;
|
||||||
|
Quantity = other.Quantity;
|
||||||
|
}
|
||||||
|
|
||||||
|
[XmlElement(ElementName = "BPIID", IsNullable = false)]
|
||||||
public int BluePrintItemID { get; set; }
|
public int BluePrintItemID { get; set; }
|
||||||
|
|
||||||
[XmlElement(ElementName = "DT", IsNullable = false)]
|
[XmlElement(ElementName = "DT", IsNullable = false)]
|
||||||
|
@ -2,9 +2,21 @@ using System.Xml.Serialization;
|
|||||||
|
|
||||||
namespace sodoff.Schema;
|
namespace sodoff.Schema;
|
||||||
|
|
||||||
public class BluePrintSpecification
|
public class BluePrintSpecification {
|
||||||
{
|
public BluePrintSpecification() {}
|
||||||
[XmlElement(ElementName = "BPSID", IsNullable = false)]
|
|
||||||
|
public BluePrintSpecification(BluePrintSpecification other) {
|
||||||
|
BluePrintSpecID = other.BluePrintSpecID;
|
||||||
|
BluePrintItemID = other.BluePrintItemID;
|
||||||
|
ItemID = other.ItemID;
|
||||||
|
CategoryID = other.CategoryID;
|
||||||
|
ItemRarity = other.ItemRarity;
|
||||||
|
Tier = other.Tier;
|
||||||
|
Quantity = other.Quantity;
|
||||||
|
SpecificationType = other.SpecificationType;
|
||||||
|
}
|
||||||
|
|
||||||
|
[XmlElement(ElementName = "BPSID", IsNullable = false)]
|
||||||
public int BluePrintSpecID { get; set; }
|
public int BluePrintSpecID { get; set; }
|
||||||
|
|
||||||
[XmlElement(ElementName = "BPIID", IsNullable = false)]
|
[XmlElement(ElementName = "BPIID", IsNullable = false)]
|
||||||
|
@ -3,8 +3,13 @@ using System.Xml.Serialization;
|
|||||||
namespace sodoff.Schema;
|
namespace sodoff.Schema;
|
||||||
|
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class CompletionAction
|
public class CompletionAction {
|
||||||
{
|
public CompletionAction() {}
|
||||||
[XmlElement(ElementName = "Transition")]
|
|
||||||
|
public CompletionAction(CompletionAction other) {
|
||||||
|
Transition = other.Transition;
|
||||||
|
}
|
||||||
|
|
||||||
|
[XmlElement(ElementName = "Transition")]
|
||||||
public StateTransition Transition;
|
public StateTransition Transition;
|
||||||
}
|
}
|
||||||
|
@ -4,9 +4,15 @@ namespace sodoff.Schema;
|
|||||||
|
|
||||||
[XmlRoot(ElementName = "AT", Namespace = "")]
|
[XmlRoot(ElementName = "AT", Namespace = "")]
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class ItemAttribute
|
public class ItemAttribute {
|
||||||
{
|
public ItemAttribute() {}
|
||||||
[XmlElement(ElementName = "k")]
|
|
||||||
|
public ItemAttribute(ItemAttribute other) {
|
||||||
|
Key = other.Key;
|
||||||
|
Value = other.Value;
|
||||||
|
}
|
||||||
|
|
||||||
|
[XmlElement(ElementName = "k")]
|
||||||
public string Key;
|
public string Key;
|
||||||
|
|
||||||
[XmlElement(ElementName = "v")]
|
[XmlElement(ElementName = "v")]
|
||||||
|
@ -4,9 +4,15 @@ namespace sodoff.Schema;
|
|||||||
|
|
||||||
[XmlRoot(ElementName = "Availability", Namespace = "")]
|
[XmlRoot(ElementName = "Availability", Namespace = "")]
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class ItemAvailability
|
public class ItemAvailability {
|
||||||
{
|
public ItemAvailability() {}
|
||||||
[XmlElement(ElementName = "sdate", IsNullable = true)]
|
|
||||||
|
public ItemAvailability(ItemAvailability other) {
|
||||||
|
StartDate = other.StartDate;
|
||||||
|
EndDate = other.EndDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
[XmlElement(ElementName = "sdate", IsNullable = true)]
|
||||||
public DateTime? StartDate;
|
public DateTime? StartDate;
|
||||||
|
|
||||||
[XmlElement(ElementName = "edate", IsNullable = true)]
|
[XmlElement(ElementName = "edate", IsNullable = true)]
|
||||||
|
@ -3,9 +3,46 @@ using System.Xml.Serialization;
|
|||||||
namespace sodoff.Schema;
|
namespace sodoff.Schema;
|
||||||
|
|
||||||
[XmlRoot(ElementName = "I", Namespace = "", IsNullable = true)]
|
[XmlRoot(ElementName = "I", Namespace = "", IsNullable = true)]
|
||||||
public class ItemData
|
public class ItemData {
|
||||||
{
|
public ItemData() {}
|
||||||
[XmlElement(ElementName = "is")]
|
|
||||||
|
public ItemData(ItemData other) {
|
||||||
|
ItemStates = other.ItemStates.Select(s => new ItemState(s)).ToList();
|
||||||
|
ItemRarity = other.ItemRarity;
|
||||||
|
PossibleStatsMap = new ItemPossibleStatsMap(other.PossibleStatsMap);
|
||||||
|
ItemStatsMap = new ItemStatsMap(other.ItemStatsMap);
|
||||||
|
ItemSaleConfigs = other.ItemSaleConfigs.Select(cfg => new ItemSaleConfig(cfg)).ToArray();
|
||||||
|
BluePrint = new BluePrint(other.BluePrint);
|
||||||
|
AssetName = other.AssetName;
|
||||||
|
Attribute = other.Attribute.Select(attr => new ItemAttribute(attr)).ToArray();
|
||||||
|
Category = other.Category.Select(cat => new ItemDataCategory(cat)).ToArray();
|
||||||
|
Cost = other.Cost;
|
||||||
|
CashCost = other.CashCost;
|
||||||
|
CreativePoints = other.CreativePoints;
|
||||||
|
Description = other.Description;
|
||||||
|
IconName = other.IconName;
|
||||||
|
InventoryMax = other.InventoryMax;
|
||||||
|
ItemID = other.ItemID;
|
||||||
|
ItemName = other.ItemName;
|
||||||
|
ItemNamePlural = other.ItemNamePlural;
|
||||||
|
Locked = other.Locked;
|
||||||
|
Geometry2 = other.Geometry2;
|
||||||
|
Rollover = new ItemDataRollover(other.Rollover);
|
||||||
|
RankId = other.RankId;
|
||||||
|
Relationship = other.Relationship.Select(r => new ItemDataRelationship(r)).ToArray();
|
||||||
|
Stackable = other.Stackable;
|
||||||
|
AllowStacking = other.AllowStacking;
|
||||||
|
SaleFactor = other.SaleFactor;
|
||||||
|
Texture = other.Texture.Select(t => new ItemDataTexture(t)).ToArray();
|
||||||
|
Uses = other.Uses;
|
||||||
|
Availability = other.Availability.Select(a => new ItemAvailability(a)).ToArray();
|
||||||
|
RewardTypeID = other.RewardTypeID;
|
||||||
|
Points = other.Points;
|
||||||
|
NormalDiscoutModifier = other.NormalDiscoutModifier;
|
||||||
|
MemberDiscountModifier = other.MemberDiscountModifier;
|
||||||
|
}
|
||||||
|
|
||||||
|
[XmlElement(ElementName = "is")]
|
||||||
public List<ItemState> ItemStates { get; set; }
|
public List<ItemState> ItemStates { get; set; }
|
||||||
|
|
||||||
[XmlElement(ElementName = "ir", IsNullable = true)]
|
[XmlElement(ElementName = "ir", IsNullable = true)]
|
||||||
|
@ -4,9 +4,16 @@ namespace sodoff.Schema;
|
|||||||
|
|
||||||
[XmlRoot(ElementName = "IC", Namespace = "")]
|
[XmlRoot(ElementName = "IC", Namespace = "")]
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class ItemDataCategory
|
public class ItemDataCategory {
|
||||||
{
|
public ItemDataCategory() {}
|
||||||
[XmlElement(ElementName = "cid")]
|
|
||||||
|
public ItemDataCategory(ItemDataCategory other) {
|
||||||
|
CategoryId = other.CategoryId;
|
||||||
|
CategoryName = other.CategoryName;
|
||||||
|
IconName = other.IconName;
|
||||||
|
}
|
||||||
|
|
||||||
|
[XmlElement(ElementName = "cid")]
|
||||||
public int CategoryId;
|
public int CategoryId;
|
||||||
|
|
||||||
[XmlElement(ElementName = "cn")]
|
[XmlElement(ElementName = "cn")]
|
||||||
|
@ -4,9 +4,18 @@ namespace sodoff.Schema;
|
|||||||
|
|
||||||
[XmlRoot(ElementName = "IRE", Namespace = "")]
|
[XmlRoot(ElementName = "IRE", Namespace = "")]
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class ItemDataRelationship
|
public class ItemDataRelationship {
|
||||||
{
|
public ItemDataRelationship() {}
|
||||||
[XmlElement(ElementName = "t")]
|
|
||||||
|
public ItemDataRelationship(ItemDataRelationship other) {
|
||||||
|
Type = other.Type;
|
||||||
|
ItemId = other.ItemId;
|
||||||
|
Weight = other.Weight;
|
||||||
|
Quantity = other.Quantity;
|
||||||
|
MaxQuantity = other.MaxQuantity;
|
||||||
|
}
|
||||||
|
|
||||||
|
[XmlElement(ElementName = "t")]
|
||||||
public string Type;
|
public string Type;
|
||||||
|
|
||||||
[XmlElement(ElementName = "id")]
|
[XmlElement(ElementName = "id")]
|
||||||
|
@ -4,9 +4,15 @@ namespace sodoff.Schema;
|
|||||||
|
|
||||||
[XmlRoot(ElementName = "IRO", Namespace = "")]
|
[XmlRoot(ElementName = "IRO", Namespace = "")]
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class ItemDataRollover
|
public class ItemDataRollover {
|
||||||
{
|
public ItemDataRollover() {}
|
||||||
[XmlElement(ElementName = "d")]
|
|
||||||
|
public ItemDataRollover(ItemDataRollover other) {
|
||||||
|
DialogName = other.DialogName;
|
||||||
|
Bundle = other.Bundle;
|
||||||
|
}
|
||||||
|
|
||||||
|
[XmlElement(ElementName = "d")]
|
||||||
public string DialogName;
|
public string DialogName;
|
||||||
|
|
||||||
[XmlElement(ElementName = "b")]
|
[XmlElement(ElementName = "b")]
|
||||||
|
@ -4,9 +4,17 @@ namespace sodoff.Schema;
|
|||||||
|
|
||||||
[XmlRoot(ElementName = "IT", Namespace = "")]
|
[XmlRoot(ElementName = "IT", Namespace = "")]
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class ItemDataTexture
|
public class ItemDataTexture {
|
||||||
{
|
public ItemDataTexture() {}
|
||||||
[XmlElement(ElementName = "n")]
|
|
||||||
|
public ItemDataTexture(ItemDataTexture other) {
|
||||||
|
TextureName = other.TextureName;
|
||||||
|
TextureTypeName = other.TextureTypeName;
|
||||||
|
OffsetX = other.OffsetX;
|
||||||
|
OffsetY = other.OffsetY;
|
||||||
|
}
|
||||||
|
|
||||||
|
[XmlElement(ElementName = "n")]
|
||||||
public string TextureName;
|
public string TextureName;
|
||||||
|
|
||||||
[XmlElement(ElementName = "t")]
|
[XmlElement(ElementName = "t")]
|
||||||
|
@ -4,9 +4,17 @@ namespace sodoff.Schema;
|
|||||||
|
|
||||||
[XmlRoot(ElementName = "IPSM", Namespace = "", IsNullable = false)]
|
[XmlRoot(ElementName = "IPSM", Namespace = "", IsNullable = false)]
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class ItemPossibleStatsMap
|
public class ItemPossibleStatsMap {
|
||||||
{
|
public ItemPossibleStatsMap() {}
|
||||||
[XmlElement(ElementName = "IID", IsNullable = false)]
|
|
||||||
|
public ItemPossibleStatsMap(ItemPossibleStatsMap other) {
|
||||||
|
ItemID = other.ItemID;
|
||||||
|
ItemStatsCount = other.ItemStatsCount;
|
||||||
|
SetID = other.SetID;
|
||||||
|
Stats = other.Stats.Select(s => new Stat(s)).ToList();
|
||||||
|
}
|
||||||
|
|
||||||
|
[XmlElement(ElementName = "IID", IsNullable = false)]
|
||||||
public int ItemID { get; set; }
|
public int ItemID { get; set; }
|
||||||
|
|
||||||
[XmlElement(ElementName = "SC", IsNullable = false)]
|
[XmlElement(ElementName = "SC", IsNullable = false)]
|
||||||
|
@ -4,9 +4,18 @@ namespace sodoff.Schema;
|
|||||||
|
|
||||||
[XmlRoot(ElementName = "ISC", Namespace = "", IsNullable = true)]
|
[XmlRoot(ElementName = "ISC", Namespace = "", IsNullable = true)]
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class ItemSaleConfig
|
public class ItemSaleConfig {
|
||||||
{
|
public ItemSaleConfig() {}
|
||||||
[XmlElement(ElementName = "IID", IsNullable = true)]
|
|
||||||
|
public ItemSaleConfig(ItemSaleConfig other) {
|
||||||
|
ItemID = other.ItemID;
|
||||||
|
CategoryID = other.CategoryID;
|
||||||
|
RarityID = other.RarityID;
|
||||||
|
Quantity = other.Quantity;
|
||||||
|
RewardItemID = other.RewardItemID;
|
||||||
|
}
|
||||||
|
|
||||||
|
[XmlElement(ElementName = "IID", IsNullable = true)]
|
||||||
public int? ItemID { get; set; }
|
public int? ItemID { get; set; }
|
||||||
|
|
||||||
[XmlElement(ElementName = "CID", IsNullable = true)]
|
[XmlElement(ElementName = "CID", IsNullable = true)]
|
||||||
|
@ -4,9 +4,17 @@ namespace sodoff.Schema;
|
|||||||
|
|
||||||
[XmlRoot(ElementName = "IS", Namespace = "")]
|
[XmlRoot(ElementName = "IS", Namespace = "")]
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class ItemStat
|
public class ItemStat {
|
||||||
{
|
public ItemStat() {}
|
||||||
[XmlElement(ElementName = "ID")]
|
|
||||||
|
public ItemStat(ItemStat other) {
|
||||||
|
ItemStatID = other.ItemStatID;
|
||||||
|
Name = other.Name;
|
||||||
|
Value = other.Value;
|
||||||
|
DataType = other.DataType;
|
||||||
|
}
|
||||||
|
|
||||||
|
[XmlElement(ElementName = "ID")]
|
||||||
public int ItemStatID { get; set; }
|
public int ItemStatID { get; set; }
|
||||||
|
|
||||||
[XmlElement(ElementName = "N")]
|
[XmlElement(ElementName = "N")]
|
||||||
|
@ -4,9 +4,19 @@ namespace sodoff.Schema;
|
|||||||
|
|
||||||
[XmlRoot(ElementName = "ItemState", Namespace = "")]
|
[XmlRoot(ElementName = "ItemState", Namespace = "")]
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class ItemState
|
public class ItemState {
|
||||||
{
|
public ItemState() { }
|
||||||
[XmlElement(ElementName = "ItemStateID")]
|
|
||||||
|
public ItemState(ItemState other) {
|
||||||
|
ItemStateID = other.ItemStateID;
|
||||||
|
Name = other.Name;
|
||||||
|
Rule = new ItemStateRule(other.Rule);
|
||||||
|
Order = other.Order;
|
||||||
|
AchievementID = other.AchievementID;
|
||||||
|
Rewards = other.Rewards.Select(r => new AchievementReward(r)).ToArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
[XmlElement(ElementName = "ItemStateID")]
|
||||||
public int ItemStateID;
|
public int ItemStateID;
|
||||||
|
|
||||||
[XmlElement(ElementName = "Name")]
|
[XmlElement(ElementName = "Name")]
|
||||||
|
@ -10,8 +10,13 @@ namespace sodoff.Schema;
|
|||||||
[XmlInclude(typeof(ItemStateCriteriaSpeedUpItem))]
|
[XmlInclude(typeof(ItemStateCriteriaSpeedUpItem))]
|
||||||
[XmlInclude(typeof(ItemStateCriteriaExpiry))]
|
[XmlInclude(typeof(ItemStateCriteriaExpiry))]
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class ItemStateCriteria
|
public class ItemStateCriteria {
|
||||||
{
|
public ItemStateCriteria() {}
|
||||||
[XmlElement(ElementName = "Type")]
|
|
||||||
|
public ItemStateCriteria(ItemStateCriteria other) {
|
||||||
|
Type = other.Type;
|
||||||
|
}
|
||||||
|
|
||||||
|
[XmlElement(ElementName = "Type")]
|
||||||
public ItemStateCriteriaType Type;
|
public ItemStateCriteriaType Type;
|
||||||
}
|
}
|
||||||
|
@ -4,9 +4,15 @@ namespace sodoff.Schema;
|
|||||||
|
|
||||||
[XmlRoot(ElementName = "ItemStateRule", Namespace = "")]
|
[XmlRoot(ElementName = "ItemStateRule", Namespace = "")]
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class ItemStateRule
|
public class ItemStateRule {
|
||||||
{
|
public ItemStateRule() {}
|
||||||
[XmlElement(ElementName = "Criterias")]
|
|
||||||
|
public ItemStateRule(ItemStateRule other) {
|
||||||
|
Criterias = other.Criterias.Select(c => new ItemStateCriteria(c)).ToList();
|
||||||
|
CompletionAction = new CompletionAction(other.CompletionAction);
|
||||||
|
}
|
||||||
|
|
||||||
|
[XmlElement(ElementName = "Criterias")]
|
||||||
public List<ItemStateCriteria> Criterias;
|
public List<ItemStateCriteria> Criterias;
|
||||||
|
|
||||||
[XmlElement(ElementName = "CompletionAction")]
|
[XmlElement(ElementName = "CompletionAction")]
|
||||||
|
@ -4,9 +4,16 @@ namespace sodoff.Schema;
|
|||||||
|
|
||||||
[XmlRoot(ElementName = "ISM", Namespace = "", IsNullable = false)]
|
[XmlRoot(ElementName = "ISM", Namespace = "", IsNullable = false)]
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class ItemStatsMap
|
public class ItemStatsMap {
|
||||||
{
|
public ItemStatsMap() {}
|
||||||
[XmlElement(ElementName = "IID", IsNullable = false)]
|
|
||||||
|
public ItemStatsMap(ItemStatsMap other) {
|
||||||
|
ItemID = other.ItemID;
|
||||||
|
ItemTier = other.ItemTier;
|
||||||
|
ItemStats = other.ItemStats.Select(s => new ItemStat(s)).ToArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
[XmlElement(ElementName = "IID", IsNullable = false)]
|
||||||
public int ItemID { get; set; }
|
public int ItemID { get; set; }
|
||||||
|
|
||||||
[XmlElement(ElementName = "IT", IsNullable = false)]
|
[XmlElement(ElementName = "IT", IsNullable = false)]
|
||||||
|
@ -5,6 +5,30 @@ namespace sodoff.Schema;
|
|||||||
[XmlRoot(ElementName = "Mission", Namespace = "")]
|
[XmlRoot(ElementName = "Mission", Namespace = "")]
|
||||||
[Serializable] // FIXME: Remove serializable once we have a different way of deep copying than BinaryFormatter
|
[Serializable] // FIXME: Remove serializable once we have a different way of deep copying than BinaryFormatter
|
||||||
public class Mission {
|
public class Mission {
|
||||||
|
public Mission() {}
|
||||||
|
|
||||||
|
public Mission(Mission other) {
|
||||||
|
if (other == null) throw new ArgumentNullException(nameof(other));
|
||||||
|
MissionID = other.MissionID;
|
||||||
|
Name = other.Name;
|
||||||
|
GroupID = other.GroupID;
|
||||||
|
ParentID = other.ParentID;
|
||||||
|
Static = other.Static;
|
||||||
|
Accepted = other.Accepted;
|
||||||
|
Completed = other.Completed;
|
||||||
|
Rule = other.Rule;
|
||||||
|
VersionID = other.VersionID;
|
||||||
|
AchievementID = other.AchievementID;
|
||||||
|
AcceptanceAchievementID = other.AcceptanceAchievementID;
|
||||||
|
Repeatable = other.Repeatable;
|
||||||
|
MissionRule = new MissionRule(other.MissionRule);
|
||||||
|
|
||||||
|
Missions = other.Missions.Select(m => new Mission(m)).ToList();
|
||||||
|
Tasks = other.Tasks.Select(t => new Task(t)).ToList();
|
||||||
|
Rewards = other.Rewards.Select(r => new AchievementReward(r)).ToList();
|
||||||
|
AcceptanceRewards = other.AcceptanceRewards.Select(a => new AchievementReward(a)).ToList();
|
||||||
|
}
|
||||||
|
|
||||||
[XmlElement(ElementName = "I")]
|
[XmlElement(ElementName = "I")]
|
||||||
public int MissionID;
|
public int MissionID;
|
||||||
|
|
||||||
|
@ -5,6 +5,16 @@ namespace sodoff.Schema;
|
|||||||
[XmlRoot(ElementName = "MissionCriteria", Namespace = "")]
|
[XmlRoot(ElementName = "MissionCriteria", Namespace = "")]
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class MissionCriteria {
|
public class MissionCriteria {
|
||||||
|
public MissionCriteria() {}
|
||||||
|
|
||||||
|
public MissionCriteria(MissionCriteria other) {
|
||||||
|
Type = other.Type;
|
||||||
|
Ordered = other.Ordered;
|
||||||
|
Min = other.Min;
|
||||||
|
Repeat = other.Repeat;
|
||||||
|
RuleItems = other.RuleItems.Select(r => new RuleItem(r)).ToList();
|
||||||
|
}
|
||||||
|
|
||||||
[XmlElement(ElementName = "Type")]
|
[XmlElement(ElementName = "Type")]
|
||||||
public string Type;
|
public string Type;
|
||||||
|
|
||||||
|
@ -5,6 +5,13 @@ namespace sodoff.Schema;
|
|||||||
[XmlRoot(ElementName = "MissionRule", Namespace = "")]
|
[XmlRoot(ElementName = "MissionRule", Namespace = "")]
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class MissionRule {
|
public class MissionRule {
|
||||||
|
public MissionRule() {}
|
||||||
|
|
||||||
|
public MissionRule(MissionRule other) {
|
||||||
|
Prerequisites = other.Prerequisites.Select(p => new PrerequisiteItem(p)).ToList();
|
||||||
|
Criteria = new MissionCriteria(other.Criteria);
|
||||||
|
}
|
||||||
|
|
||||||
[XmlElement(ElementName = "Prerequisites")]
|
[XmlElement(ElementName = "Prerequisites")]
|
||||||
public List<PrerequisiteItem> Prerequisites;
|
public List<PrerequisiteItem> Prerequisites;
|
||||||
|
|
||||||
|
@ -4,9 +4,16 @@ namespace sodoff.Schema;
|
|||||||
|
|
||||||
[XmlRoot(ElementName = "Pair", Namespace = "")]
|
[XmlRoot(ElementName = "Pair", Namespace = "")]
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class Pair
|
public class Pair {
|
||||||
{
|
public Pair() {}
|
||||||
[XmlElement(ElementName = "PairKey")]
|
|
||||||
|
public Pair(Pair other) {
|
||||||
|
PairKey = other.PairKey;
|
||||||
|
PairValue = other.PairValue;
|
||||||
|
UpdateDate = other.UpdateDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
[XmlElement(ElementName = "PairKey")]
|
||||||
public string PairKey;
|
public string PairKey;
|
||||||
|
|
||||||
[XmlElement(ElementName = "PairValue")]
|
[XmlElement(ElementName = "PairValue")]
|
||||||
|
@ -5,6 +5,12 @@ namespace sodoff.Schema;
|
|||||||
[XmlRoot(ElementName = "Pairs", Namespace = "", IsNullable = true)]
|
[XmlRoot(ElementName = "Pairs", Namespace = "", IsNullable = true)]
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class PairData {
|
public class PairData {
|
||||||
|
public PairData() {}
|
||||||
|
|
||||||
|
public PairData(PairData other) {
|
||||||
|
Pairs = other.Pairs.Select(p => new Pair(p)).ToArray();
|
||||||
|
}
|
||||||
|
|
||||||
[XmlElement("Pair", IsNullable = true)]
|
[XmlElement("Pair", IsNullable = true)]
|
||||||
public Pair[] Pairs { get; set; }
|
public Pair[] Pairs { get; set; }
|
||||||
}
|
}
|
@ -5,6 +5,15 @@ namespace sodoff.Schema;
|
|||||||
[XmlRoot(ElementName = "PrerequisiteItem", Namespace = "")]
|
[XmlRoot(ElementName = "PrerequisiteItem", Namespace = "")]
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class PrerequisiteItem {
|
public class PrerequisiteItem {
|
||||||
|
public PrerequisiteItem() {}
|
||||||
|
|
||||||
|
public PrerequisiteItem(PrerequisiteItem other) {
|
||||||
|
Type = other.Type;
|
||||||
|
Value = other.Value;
|
||||||
|
Quantity = other.Quantity;
|
||||||
|
ClientRule = other.ClientRule;
|
||||||
|
}
|
||||||
|
|
||||||
[XmlElement(ElementName = "Type")]
|
[XmlElement(ElementName = "Type")]
|
||||||
public PrerequisiteRequiredType Type;
|
public PrerequisiteRequiredType Type;
|
||||||
|
|
||||||
|
@ -5,6 +5,15 @@ namespace sodoff.Schema;
|
|||||||
[XmlRoot(ElementName = "RuleItem", Namespace = "")]
|
[XmlRoot(ElementName = "RuleItem", Namespace = "")]
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class RuleItem {
|
public class RuleItem {
|
||||||
|
public RuleItem() {}
|
||||||
|
|
||||||
|
public RuleItem(RuleItem other) {
|
||||||
|
Type = other.Type;
|
||||||
|
MissionID = other.MissionID;
|
||||||
|
ID = other.ID;
|
||||||
|
Complete = other.Complete;
|
||||||
|
}
|
||||||
|
|
||||||
[XmlElement(ElementName = "Type")]
|
[XmlElement(ElementName = "Type")]
|
||||||
public RuleItemType Type;
|
public RuleItemType Type;
|
||||||
|
|
||||||
|
@ -4,9 +4,18 @@ namespace sodoff.Schema;
|
|||||||
|
|
||||||
[XmlRoot(ElementName = "STAT", Namespace = "", IsNullable = false)]
|
[XmlRoot(ElementName = "STAT", Namespace = "", IsNullable = false)]
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class Stat
|
public class Stat {
|
||||||
{
|
public Stat() {}
|
||||||
[XmlElement(ElementName = "IID", IsNullable = false)]
|
|
||||||
|
public Stat(Stat other) {
|
||||||
|
ItemID = other.ItemID;
|
||||||
|
ItemStatsID = other.ItemStatsID;
|
||||||
|
SetID = other.SetID;
|
||||||
|
Probability = other.Probability;
|
||||||
|
ItemStatsRangeMaps = other.ItemStatsRangeMaps.Select(s => new StatRangeMap(s)).ToList();
|
||||||
|
}
|
||||||
|
|
||||||
|
[XmlElement(ElementName = "IID", IsNullable = false)]
|
||||||
public int ItemID { get; set; }
|
public int ItemID { get; set; }
|
||||||
|
|
||||||
[XmlElement(ElementName = "ISID", IsNullable = false)]
|
[XmlElement(ElementName = "ISID", IsNullable = false)]
|
||||||
|
@ -4,9 +4,18 @@ namespace sodoff.Schema;
|
|||||||
|
|
||||||
[XmlRoot(ElementName = "SRM", Namespace = "", IsNullable = false)]
|
[XmlRoot(ElementName = "SRM", Namespace = "", IsNullable = false)]
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class StatRangeMap
|
public class StatRangeMap {
|
||||||
{
|
public StatRangeMap() {}
|
||||||
[XmlElement(ElementName = "ISID", IsNullable = false)]
|
|
||||||
|
public StatRangeMap(StatRangeMap other) {
|
||||||
|
ItemStatsID = other.ItemStatsID;
|
||||||
|
ItemStatsName = other.ItemStatsName;
|
||||||
|
ItemTierID = other.ItemTierID;
|
||||||
|
StartRange = other.StartRange;
|
||||||
|
EndRange = other.EndRange;
|
||||||
|
}
|
||||||
|
|
||||||
|
[XmlElement(ElementName = "ISID", IsNullable = false)]
|
||||||
public int ItemStatsID { get; set; }
|
public int ItemStatsID { get; set; }
|
||||||
|
|
||||||
[XmlElement(ElementName = "ISN", IsNullable = false)]
|
[XmlElement(ElementName = "ISN", IsNullable = false)]
|
||||||
|
@ -8,6 +8,17 @@ namespace sodoff.Schema;
|
|||||||
[XmlRoot(ElementName = "Task", Namespace = "")]
|
[XmlRoot(ElementName = "Task", Namespace = "")]
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class Task {
|
public class Task {
|
||||||
|
public Task() {}
|
||||||
|
|
||||||
|
public Task(Task other) {
|
||||||
|
TaskID = other.TaskID;
|
||||||
|
Name = other.Name;
|
||||||
|
Static = other.Static;
|
||||||
|
Completed = other.Completed;
|
||||||
|
Failed = other.Failed;
|
||||||
|
Payload = other.Payload;
|
||||||
|
}
|
||||||
|
|
||||||
[XmlElement(ElementName = "I")]
|
[XmlElement(ElementName = "I")]
|
||||||
public int TaskID;
|
public int TaskID;
|
||||||
|
|
||||||
|
@ -4,9 +4,23 @@ namespace sodoff.Schema;
|
|||||||
|
|
||||||
[XmlRoot(ElementName = "UserItem", Namespace = "")]
|
[XmlRoot(ElementName = "UserItem", Namespace = "")]
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class UserItemData
|
public class UserItemData {
|
||||||
{
|
public UserItemData() {}
|
||||||
[XmlElement(ElementName = "iid")]
|
|
||||||
|
public UserItemData(UserItemData other) {
|
||||||
|
ItemID = other.ItemID;
|
||||||
|
ModifiedDate = other.ModifiedDate;
|
||||||
|
UserItemAttributes = new PairData(other.UserItemAttributes);
|
||||||
|
ItemStats = other.ItemStats.Select(stat => new ItemStat(stat)).ToArray();
|
||||||
|
ItemTier = other.ItemTier;
|
||||||
|
CreatedDate = other.CreatedDate;
|
||||||
|
UserInventoryID = other.UserInventoryID;
|
||||||
|
Quantity = other.Quantity;
|
||||||
|
Uses = other.Uses;
|
||||||
|
Item = new ItemData(other.Item);
|
||||||
|
}
|
||||||
|
|
||||||
|
[XmlElement(ElementName = "iid")]
|
||||||
public int ItemID { get; set; }
|
public int ItemID { get; set; }
|
||||||
|
|
||||||
[XmlElement(ElementName = "md", IsNullable = true)]
|
[XmlElement(ElementName = "md", IsNullable = true)]
|
||||||
|
@ -119,20 +119,8 @@ public class MissionStoreSingleton {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: Don't use BinaryFormatter for deep copying
|
|
||||||
// FIXME: Remove <EnableUnsafeBinaryFormatterSerialization> flag from the project file once we have a different way of deep copying
|
|
||||||
public static Mission DeepCopy(Mission original) {
|
public static Mission DeepCopy(Mission original) {
|
||||||
using (MemoryStream memoryStream = new MemoryStream()) {
|
return new Mission(original);
|
||||||
BinaryFormatter formatter = new BinaryFormatter();
|
|
||||||
|
|
||||||
formatter.Serialize(memoryStream, original);
|
|
||||||
|
|
||||||
memoryStream.Position = 0;
|
|
||||||
|
|
||||||
Mission clone = (Mission)formatter.Deserialize(memoryStream);
|
|
||||||
|
|
||||||
return clone;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
<TargetFramework>net9.0</TargetFramework>
|
<TargetFramework>net9.0</TargetFramework>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<EnableUnsafeBinaryFormatterSerialization>true</EnableUnsafeBinaryFormatterSerialization>
|
|
||||||
|
|
||||||
<DefineConstants>USE_SQLITE;$(DefineConstants)</DefineConstants>
|
<DefineConstants>USE_SQLITE;$(DefineConstants)</DefineConstants>
|
||||||
<DefineConstants>USE_POSTGRESQL;$(DefineConstants)</DefineConstants>
|
<DefineConstants>USE_POSTGRESQL;$(DefineConstants)</DefineConstants>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user