diff --git a/SabberStoneCore/src/Auras/AdaptiveCostEffect.cs b/SabberStoneCore/src/Auras/AdaptiveCostEffect.cs
index e49b58bc9..bd380c363 100644
--- a/SabberStoneCore/src/Auras/AdaptiveCostEffect.cs
+++ b/SabberStoneCore/src/Auras/AdaptiveCostEffect.cs
@@ -28,6 +28,7 @@ namespace SabberStoneCore.Auras
///
/// Implementation of the specific effects of varying cost. e.g. Giants
///
+ [Serializable]
public class AdaptiveCostEffect : IAura
{
// Consider make these subclasses
diff --git a/SabberStoneCore/src/Auras/AdaptiveEffect.cs b/SabberStoneCore/src/Auras/AdaptiveEffect.cs
index 298cde91e..88f400596 100644
--- a/SabberStoneCore/src/Auras/AdaptiveEffect.cs
+++ b/SabberStoneCore/src/Auras/AdaptiveEffect.cs
@@ -12,6 +12,7 @@ namespace SabberStoneCore.Auras
///
/// Effects of this kind of Auras are influenced by other factors in game, in real time. e.g. Lightspawn, Southsea Deckhand.
///
+ [Serializable]
public class AdaptiveEffect : IAura
{
private readonly bool _isSwitching;
diff --git a/SabberStoneCore/src/Auras/AdjacentAura.cs b/SabberStoneCore/src/Auras/AdjacentAura.cs
index 6a78a1e5a..27ec4664a 100644
--- a/SabberStoneCore/src/Auras/AdjacentAura.cs
+++ b/SabberStoneCore/src/Auras/AdjacentAura.cs
@@ -1,4 +1,5 @@
-using System.Collections.Generic;
+using System;
+using System.Collections.Generic;
using SabberStoneCore.Enchants;
using SabberStoneCore.Enums;
using SabberStoneCore.Kettle;
@@ -9,6 +10,7 @@
namespace SabberStoneCore.Auras
{
+ [Serializable]
public class AdjacentAura : IAura
{
private Minion _left;
diff --git a/SabberStoneCore/src/Auras/Aura.cs b/SabberStoneCore/src/Auras/Aura.cs
index 494954ca0..38249e849 100644
--- a/SabberStoneCore/src/Auras/Aura.cs
+++ b/SabberStoneCore/src/Auras/Aura.cs
@@ -18,12 +18,15 @@ namespace SabberStoneCore.Auras
/// Aura must be activated first to affect entities.
/// The effect of an aura is applied or removed during .
///
+ [Serializable]
public class Aura : IAura
{
private protected enum Instruction
{
Invalid, RemoveAll, AddAll, Add, Remove, /*CheckAdjacency*/
}
+
+ [Serializable]
private protected readonly struct AuraUpdateInstruction : IEquatable
{
public readonly IPlayable Src;
diff --git a/SabberStoneCore/src/Auras/EnrageEffect.cs b/SabberStoneCore/src/Auras/EnrageEffect.cs
index 326ead50e..4629f46aa 100644
--- a/SabberStoneCore/src/Auras/EnrageEffect.cs
+++ b/SabberStoneCore/src/Auras/EnrageEffect.cs
@@ -1,4 +1,5 @@
-using System.Linq;
+using System;
+using System.Linq;
using System.Text;
using SabberStoneCore.Actions;
using SabberStoneCore.Enchants;
@@ -10,6 +11,7 @@ namespace SabberStoneCore.Auras
///
/// Implementation of the Enrage effect.
///
+ [Serializable]
public class EnrageEffect : Aura
{
private bool _enraged;
diff --git a/SabberStoneCore/src/Auras/MultiAura.cs b/SabberStoneCore/src/Auras/MultiAura.cs
index c0809801d..0ededfdc5 100644
--- a/SabberStoneCore/src/Auras/MultiAura.cs
+++ b/SabberStoneCore/src/Auras/MultiAura.cs
@@ -1,4 +1,5 @@
-using System.Collections;
+using System;
+using System.Collections;
using System.Collections.Generic;
using System.Text;
using SabberStoneCore.Enchants;
@@ -9,6 +10,7 @@ namespace SabberStoneCore.Auras
///
/// A container class for multiple auras. Use this when you want to implement a with multiple auras.
///
+ [Serializable]
public class MultiAura : IAura, IReadOnlyList
{
private readonly IReadOnlyList _auras;
diff --git a/SabberStoneCore/src/Auras/SummoningPortalAura.cs b/SabberStoneCore/src/Auras/SummoningPortalAura.cs
index 3071b0717..5f95b75e3 100644
--- a/SabberStoneCore/src/Auras/SummoningPortalAura.cs
+++ b/SabberStoneCore/src/Auras/SummoningPortalAura.cs
@@ -1,7 +1,9 @@
-using SabberStoneCore.Model.Entities;
+using System;
+using SabberStoneCore.Model.Entities;
namespace SabberStoneCore.Auras
{
+ [Serializable]
public class SummoningPortalAura : Aura
{
public SummoningPortalAura() : base(AuraType.HAND) { }
diff --git a/SabberStoneCore/src/Auras/SwitchingAura.cs b/SabberStoneCore/src/Auras/SwitchingAura.cs
index ec7acd9fb..b1c36cd0c 100644
--- a/SabberStoneCore/src/Auras/SwitchingAura.cs
+++ b/SabberStoneCore/src/Auras/SwitchingAura.cs
@@ -23,6 +23,7 @@
namespace SabberStoneCore.Auras
{
+ [Serializable]
public class SwitchingAura : Aura
{
private readonly SelfCondition _initialisationCondtion;
diff --git a/SabberStoneCore/src/Conditions/RelaCondition.cs b/SabberStoneCore/src/Conditions/RelaCondition.cs
index 5747564bc..dda821395 100644
--- a/SabberStoneCore/src/Conditions/RelaCondition.cs
+++ b/SabberStoneCore/src/Conditions/RelaCondition.cs
@@ -20,9 +20,11 @@ namespace SabberStoneCore.Conditions
/// Container for all conditions about the relation between 2
/// instances.
///
+ [Serializable]
public class RelaCondition
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
{
+ [NonSerialized]
private readonly Func _function;
public static RelaCondition IsMyWeapon => new RelaCondition((me, other) => me.Controller.Hero.Weapon != null && me.Controller.Hero.Weapon == other);
diff --git a/SabberStoneCore/src/Conditions/SelfCondition.cs b/SabberStoneCore/src/Conditions/SelfCondition.cs
index 258beab59..8ddb96f66 100644
--- a/SabberStoneCore/src/Conditions/SelfCondition.cs
+++ b/SabberStoneCore/src/Conditions/SelfCondition.cs
@@ -22,68 +22,99 @@ namespace SabberStoneCore.Conditions
/// Container for all conditions about the subject
/// instance.
///
+ [Serializable]
public class SelfCondition
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
{
+ [NonSerialized]
public static readonly SelfCondition IsDead = new SelfCondition(me => me.ToBeDestroyed && me.Card.Type == CardType.MINION);
+ [NonSerialized]
public static readonly SelfCondition IsNotImmune = new SelfCondition(me => me is ICharacter && !((ICharacter)me).IsImmune);
+ [NonSerialized]
public static readonly SelfCondition IsSilenced = new SelfCondition(me => me is ICharacter && ((ICharacter)me).IsSilenced);
+ [NonSerialized]
public static readonly SelfCondition IsBoardFull = new SelfCondition(me => me.Controller.BoardZone.IsFull);
+ [NonSerialized]
public static readonly SelfCondition IsHandEmpty = new SelfCondition(me => me.Controller.HandZone.IsEmpty);
+ [NonSerialized]
public static readonly SelfCondition IsDeckEmpty = new SelfCondition(me => me.Controller.DeckZone.IsEmpty);
+ [NonSerialized]
public static readonly SelfCondition IsOpDeckNotEmpty = new SelfCondition(me => !me.Controller.Opponent.DeckZone.IsEmpty);
+ [NonSerialized]
public static readonly SelfCondition IsHandNotEmpty = new SelfCondition(me => !me.Controller.HandZone.IsEmpty);
+ [NonSerialized]
public static readonly SelfCondition IsHandFull = new SelfCondition(me => me.Controller.HandZone.IsFull);
+ [NonSerialized]
public static readonly SelfCondition IsOpHandEmpty = new SelfCondition(me => me.Controller.Opponent.HandZone.IsEmpty);
+ [NonSerialized]
public static readonly SelfCondition IsOpHandFull = new SelfCondition(me => me.Controller.Opponent.HandZone.IsFull);
//public static SelfCondition IsStackEmpty => new SelfCondition(me => me == null);
-
+ [NonSerialized]
public static readonly SelfCondition IsCurrentPlayer = new SelfCondition(me => me.Game.CurrentPlayer == me.Controller);
+ [NonSerialized]
public static readonly SelfCondition IsNotCurrentPlayer = new SelfCondition(me => me.Game.CurrentPlayer != me.Controller);
-
+ [NonSerialized]
public static readonly SelfCondition IsComboActive = new SelfCondition(me => me.Controller.IsComboActive);
+ [NonSerialized]
public static readonly SelfCondition IsAnyWeaponEquiped = new SelfCondition(me => (me as Hero)?.Weapon != null);
+ [NonSerialized]
public static readonly SelfCondition IsThisWeaponEquiped = new SelfCondition(me => me.Controller.Hero.Weapon == me);
-
+ [NonSerialized]
public static readonly SelfCondition IsDamaged = new SelfCondition(me => me is ICharacter && ((ICharacter)me).Damage > 0);
+ [NonSerialized]
public static readonly SelfCondition IsUndamaged = new SelfCondition(me => me is ICharacter && ((ICharacter)me).Damage == 0);
public static SelfCondition IsControllingRace(Race race) => new SelfCondition(me => me.Controller.BoardZone.Any(p => p.Card.IsRace(race)));
-
+ [NonSerialized]
public static readonly SelfCondition IsControllingFrozen =
new SelfCondition(me => me.Controller.BoardZone.Any(p => p.IsFrozen));
+ [NonSerialized]
public static readonly SelfCondition IsControllingSecret = new SelfCondition(me => me.Controller.SecretZone.Count > 0);
-
+ [NonSerialized]
public static readonly SelfCondition IsDragonInHand = new SelfCondition(me => me.Controller.HandZone.Any(p => p is ICharacter && ((ICharacter)p).IsRace(Race.DRAGON)));
+ [NonSerialized]
public static readonly SelfCondition Is5PlusAtkInHand = new SelfCondition(me => me.Controller.HandZone.Any(p => p is ICharacter && ((ICharacter)p).AttackDamage >= 5));
-
+ [NonSerialized]
public static readonly SelfCondition Has5PlusCostSpellInHand = new SelfCondition(me =>
me.Controller.HandZone.Any(p => p.Card.Type == CardType.SPELL && p.Cost >= 5));
public static SelfCondition IsRace(Race race) => new SelfCondition(me => me is ICharacter ch && ch.IsRace(race));
public static SelfCondition IsNotRace(Race race) => new SelfCondition(me => me is ICharacter ch && !ch.IsRace(race));
+ [NonSerialized]
public static readonly SelfCondition IsMinion = new SelfCondition(me => me is Minion);
+ [NonSerialized]
public static readonly SelfCondition IsSpell = new SelfCondition(me => me is Spell);
+ [NonSerialized]
public static readonly SelfCondition IsSecret = new SelfCondition(me => me.Card.IsSecret);
+ [NonSerialized]
public static readonly SelfCondition IsWeapon = new SelfCondition(me => me is Weapon);
+ [NonSerialized]
public static readonly SelfCondition IsWeaponEquiped = new SelfCondition(me => me.Controller.Hero.Weapon != null);
+ [NonSerialized]
public static readonly SelfCondition IsHero = new SelfCondition(me => me is Hero);
+ [NonSerialized]
public static readonly SelfCondition IsHeroPower = new SelfCondition(me => me is HeroPower);
-
+ [NonSerialized]
public static readonly SelfCondition IsHeroPowerTargetingMinion = new SelfCondition(me =>
me.Card.Type == CardType.HERO_POWER &&
me.Game.CurrentEventData.EventTarget.Card.Type == CardType.MINION);
public static SelfCondition HasArmorLessThan(int amount) => new SelfCondition(me => me.Controller.Hero.Armor < amount);
+ [NonSerialized]
public static readonly SelfCondition IsAttacking = new SelfCondition(me => me is ICharacter && ((ICharacter)me).IsAttacking);
+ [NonSerialized]
public static readonly SelfCondition IsCthun = new SelfCondition(me => me.Card.Id.Equals("OG_280"));
+ [NonSerialized]
public static readonly SelfCondition IsSilverHandRecruit = new SelfCondition(me => me.Card.Id.Equals("CS2_101t"));
+ [NonSerialized]
public static readonly SelfCondition IsTreant = new SelfCondition(me => me.Card.Name == "Treant");
-
+ [NonSerialized]
public static readonly SelfCondition IsControllingTreant =
new SelfCondition(me => me.Controller.BoardZone.Any(m => m.Card.Name == "Treant"));
+ [NonSerialized]
public static readonly SelfCondition IsControllingLackey =
new SelfCondition(me => me.Controller.BoardZone.Any(m => m.Card[Enums.GameTag.MARK_OF_EVIL] == 1));
-
+ [NonSerialized]
public static readonly SelfCondition IsSpellDmgOnHero = new SelfCondition(me => me.Controller.CurrentSpellPower > 0);
+ [NonSerialized]
public static readonly SelfCondition IsntSpellDmgOnHero = new SelfCondition(me => me.Controller.CurrentSpellPower == 0);
public static SelfCondition IsNotAttackingThisTurn(int number) => new SelfCondition(me => me is ICharacter ch && ch.NumAttacksThisTurn == number);
public static SelfCondition IsCardId(string cardId) => new SelfCondition(me => me.Card.Id == cardId);
@@ -94,32 +125,49 @@ public class SelfCondition
public static SelfCondition SpellsPlayedThisTurn(int number) => new SelfCondition(me =>
me.Controller.CardsPlayedThisTurn.Count(card => card.Type == CardType.SPELL) == number);
+
public static SelfCondition ElementalPlayedLastTurn => new SelfCondition(me => me.Controller.NumElementalsPlayedLastTurn > 0);
public static SelfCondition HasMinionInDeck() => new SelfCondition(me => me.Controller.DeckZone.Any(p => p is Minion));
+
public static SelfCondition HasMinionInDeck(GameTag tag) => new SelfCondition(me => me.Controller.DeckZone.Any(p => p is Minion && p[tag] > 0));
+ [NonSerialized]
public static readonly SelfCondition HasSpellInDeck = new SelfCondition(me => me.Controller.DeckZone.Any(p => p is Spell));
+ [NonSerialized]
public static readonly SelfCondition IsNoDupeInDeck = new SelfCondition(me => !me.Controller.DeckZone.GroupBy(x => new { x.Card.Id }).Any(x => x.Skip(1).Any()));
public static SelfCondition HasNoSpecficCostCardsInDeck(int cost) => new SelfCondition(me => !me.Controller.DeckZone.Any(x => x.Cost == cost));
+ [NonSerialized]
public static readonly SelfCondition HasNoMinionInDeck = new SelfCondition(me => !me.Controller.DeckZone.Any(p => p is Minion));
+ [NonSerialized]
public static readonly SelfCondition HasNoOddCostInDeck = new SelfCondition(me => me.Controller.DeckZone.NoOddCostCards);
+ [NonSerialized]
public static readonly SelfCondition HasNoEvenCostInDeck = new SelfCondition(me => me.Controller.DeckZone.NoEvenCostCards);
-
+ [NonSerialized]
public static readonly SelfCondition HasMinionInHand = new SelfCondition(me => me.Controller.HandZone.Any(p => p is Minion));
+ [NonSerialized]
public static readonly SelfCondition HasMyHeroAttackedThisTurn = new SelfCondition(me => me.Controller.Hero.NumAttacksThisTurn > 0);
+ [NonSerialized]
public static readonly SelfCondition HasMyHeroNotAttackedThisTurn = new SelfCondition(me => me.Controller.Hero.NumAttacksThisTurn == 0);
+ [NonSerialized]
public static readonly SelfCondition IsMyHeroDamagedThisTurn = new SelfCondition(me => me.Controller.Hero.DamageTakenThisTurn > 0);
+ [NonSerialized]
public static readonly SelfCondition IsDeathrattleCard = new SelfCondition(me => me.Card.Deathrattle);
+ [NonSerialized]
public static readonly SelfCondition IsEchoCard = new SelfCondition(me => me.Card.Echo);
+ [NonSerialized]
public static readonly SelfCondition IsComboCard = new SelfCondition(me => me.Card.Combo);
+ [NonSerialized]
public static readonly SelfCondition IsLifestealCard = new SelfCondition(me => me.Card.LifeSteal);
+ [NonSerialized]
public static readonly SelfCondition IsDeathrattleMinion = new SelfCondition(me => me is Minion minion && minion.HasDeathrattle);
+ [NonSerialized]
public static readonly SelfCondition IsBattlecryMinion = new SelfCondition(me => me is Minion minion && minion.HasBattleCry);
+ [NonSerialized]
public static readonly SelfCondition HasRush = new SelfCondition(me => me is Minion minion && minion.IsRush);
-
+ [NonSerialized]
public static readonly SelfCondition IsCthunDead = new SelfCondition(me => me.Controller.GraveyardZone.Any(p => p.Card.Id.Equals("OG_280")));
-
+ [NonSerialized]
public static readonly SelfCondition NotPlayedAnySpellThisTurn =
new SelfCondition(me => me.Controller.CardsPlayedThisTurn.All(p => p.Type != CardType.SPELL));
//public static SelfCondition NumSpellPlayedThisturn
@@ -132,47 +180,64 @@ public static SelfCondition IsInZone(Zone zone) =>
? me.Zone.Type == zone
: me.NativeTags.TryGetValue(GameTag.ZONE, out int value) && (Zone)value == zone);
-
+ [NonSerialized]
public static readonly SelfCondition IsOverloadCard = new SelfCondition(me => me.Card.HasOverload);
+ [NonSerialized]
public static readonly SelfCondition IsBattleCryCard = new SelfCondition(me => me.Card.Tags.ContainsKey(GameTag.BATTLECRY));
+ [NonSerialized]
public static readonly SelfCondition IsChooseOneCard = new SelfCondition(me => me.Card.ChooseOne);
+ [NonSerialized]
public static readonly SelfCondition HasTaunt = new SelfCondition(me => me is Minion m && m.HasTaunt);
+ [NonSerialized]
public static readonly SelfCondition IsFrozen = new SelfCondition(me => me is ICharacter character && character.IsFrozen);
+
public static SelfCondition IsHeroPowerCard(string cardId) => new SelfCondition(me => me.Controller.Hero.HeroPower.Card.Id.Equals(cardId));
+ [NonSerialized]
public static readonly SelfCondition IsManaCrystalFull = new SelfCondition(me => me.Controller.BaseMana == 10);
+ [NonSerialized]
public static readonly SelfCondition IsRemaningManaFull = new SelfCondition(me => me.Controller.RemainingMana == 10);
-
+ [NonSerialized]
public static readonly SelfCondition IsNotDead = new SelfCondition(me => me is ICharacter && !me.ToBeDestroyed);
+ [NonSerialized]
public static readonly SelfCondition IsNotUntouchable = new SelfCondition(me => !me.Card.Untouchable);
+ [NonSerialized]
public static readonly SelfCondition IsNotSilenced = new SelfCondition(me => me is ICharacter && !((ICharacter)me).IsSilenced);
+ [NonSerialized]
public static readonly SelfCondition IsNotBoardFull = new SelfCondition(me => !me.Controller.BoardZone.IsFull);
+ [NonSerialized]
public static readonly SelfCondition IsDurabilityOkay = new SelfCondition(me => me is Weapon && ((Weapon)me).Durability > 0);
-
+ [NonSerialized]
public static readonly SelfCondition IsAnyNotImmune = new SelfCondition(me => me.Game.Characters.Exists(p => !p.IsImmune));
+ [NonSerialized]
public static readonly SelfCondition IsOpNotBoardFull = new SelfCondition(me => !me.Controller.Opponent.BoardZone.IsFull);
+ [NonSerialized]
public static readonly SelfCondition IsOpTurn = new SelfCondition(me => me.Controller != me.Game.CurrentPlayer);
+ [NonSerialized]
public static readonly SelfCondition IsMyTurn = new SelfCondition(me => me.Controller == me.Game.CurrentPlayer);
+ [NonSerialized]
public static readonly SelfCondition IsSecretOrQuestActive = new SelfCondition(me => me.Zone.Type == Zone.SECRET);
+ [NonSerialized]
public static readonly SelfCondition IsQuestDone = new SelfCondition(me => me[GameTag.QUEST_PROGRESS] == me[GameTag.QUEST_PROGRESS_TOTAL]);
-
+ [NonSerialized]
public static readonly SelfCondition IsSpellTargetingMinion = new SelfCondition(me =>
me.Card.Type == CardType.SPELL && me.Game.IdEntityDic[me.CardTarget].Card.Type == CardType.MINION);
-
+ [NonSerialized]
public static readonly SelfCondition HoldingAnotherClassCard =
new SelfCondition(me => me.Controller.HandZone.Any(p => p.Card.Class != me.Controller.HeroClass));
//public static SelfCondition IsProposedDefender(CardType cardType) => new SelfCondition(me => me is ICharacter && me.Game.IdEntityDic[me.Game.ProposedDefender].Card.Type == cardType);
- public static SelfCondition IsProposedDefender(CardType cardType) => IsEventTargetIs(cardType);
+ public static SelfCondition IsProposedDefender(CardType cardType) => IsEventTargetIs(cardType);
+ [NonSerialized]
public static readonly SelfCondition HasLessHandCardsThenOp = new SelfCondition(me => me.Controller.HandZone.Count < me.Controller.Opponent.HandZone.Count);
-
+ [NonSerialized]
public static readonly SelfCondition IsAnyDiedThisTurn = new SelfCondition(p => p.Controller.NumFriendlyMinionsThatDiedThisTurn + p.Controller.Opponent.NumFriendlyMinionsThatDiedThisTurn > 0);
-
+ [NonSerialized]
public static readonly SelfCondition DoesOpHasMoresMinions =
new SelfCondition(me => me.Controller.BoardZone.CountExceptUntouchables < me.Controller.Opponent.BoardZone.CountExceptUntouchables);
-
+ [NonSerialized]
public static readonly SelfCondition HasTarget = new SelfCondition(me => me.CardTarget > 0);
-
+
public static SelfCondition AnyNonClassCardInHand(CardClass cardClass)
=> new SelfCondition(me => me.Controller.HandZone.Any(p => p.Card.Class != cardClass));
@@ -187,7 +252,7 @@ public static SelfCondition IsOpZoneCount(Zone zone, int amount, RelaSign relaSi
relaSign == RelaSign.EQ && me.Controller.Opponent.ControlledZones[zone].Count == amount
|| relaSign == RelaSign.GEQ && me.Controller.Opponent.ControlledZones[zone].Count >= amount
|| relaSign == RelaSign.LEQ && me.Controller.Opponent.ControlledZones[zone].Count <= amount);
-
+
public static SelfCondition HasBoardMinion(GameTag tag, int amount, RelaSign relaSign = RelaSign.EQ)
=> new SelfCondition(me =>
{
@@ -195,7 +260,7 @@ public static SelfCondition HasBoardMinion(GameTag tag, int amount, RelaSign rel
|| relaSign == RelaSign.GEQ && me.Controller.BoardZone.Any(p => GetTagValue(p, tag) >= amount)
|| relaSign == RelaSign.LEQ && me.Controller.BoardZone.Any(p => GetTagValue(p, tag) <= amount);
});
-
+
public static SelfCondition HasOpBoardMinion(GameTag tag, int amount, RelaSign relaSign = RelaSign.EQ)
=> new SelfCondition(me =>
{
@@ -204,7 +269,7 @@ public static SelfCondition HasOpBoardMinion(GameTag tag, int amount, RelaSign r
|| relaSign == RelaSign.GEQ && me.Controller.Opponent.BoardZone.Any(p => GetTagValue(p, tag) >= amount)
|| relaSign == RelaSign.LEQ && me.Controller.Opponent.BoardZone.Any(p => GetTagValue(p, tag) <= amount);
});
-
+
public static SelfCondition HasOp(GameTag tag, int amount, RelaSign relaSign = RelaSign.EQ)
=> new SelfCondition(me =>
relaSign == RelaSign.EQ &&
@@ -217,7 +282,7 @@ public static SelfCondition HasOp(GameTag tag, int amount, RelaSign relaSign = R
me.Controller.Opponent.BoardZone.Any(p => p[tag] <= amount
|| me.Controller.Opponent.Hero[tag] <= amount));
-
+
public static SelfCondition IsCost(int value, RelaSign relaSign = RelaSign.EQ)
{
return new SelfCondition(me =>
@@ -229,7 +294,7 @@ public static SelfCondition IsCost(int value, RelaSign relaSign = RelaSign.EQ)
|| relaSign == RelaSign.LEQ && val <= value;
});
}
-
+
public static SelfCondition IsTagValue(GameTag tag, int value, RelaSign relaSign = RelaSign.EQ)
{
return new SelfCondition(me =>
@@ -241,13 +306,13 @@ public static SelfCondition IsTagValue(GameTag tag, int value, RelaSign relaSign
|| relaSign == RelaSign.LEQ && val <= value;
});
}
-
+
public static SelfCondition IsBaseTagValue(GameTag tag, int value, RelaSign relaSign = RelaSign.EQ)
=> new SelfCondition(me =>
relaSign == RelaSign.EQ && me.Card[tag] == value
|| relaSign == RelaSign.GEQ && me.Card[tag] >= value
|| relaSign == RelaSign.LEQ && me.Card[tag] <= value);
-
+
public static SelfCondition IsCthunGameTag(GameTag tag, int value, RelaSign relaSign = RelaSign.EQ)
=> new SelfCondition(me =>
{
@@ -261,28 +326,28 @@ public static SelfCondition IsCthunGameTag(GameTag tag, int value, RelaSign rela
|| relaSign == RelaSign.GEQ && val >= value
|| relaSign == RelaSign.LEQ && val <= value;
});
-
+
public static SelfCondition IsHealth(int value, RelaSign relaSign)
=> new SelfCondition(me => relaSign == RelaSign.EQ && me is ICharacter && ((ICharacter)me).Health == value
|| relaSign == RelaSign.GEQ && me is ICharacter && ((ICharacter)me).Health >= value
|| relaSign == RelaSign.LEQ && me is ICharacter && ((ICharacter)me).Health <= value);
-
+
public static SelfCondition IsBoardCount(int value, RelaSign relaSign = RelaSign.EQ)
=> new SelfCondition(me => relaSign == RelaSign.EQ && me.Controller.BoardZone.CountExceptUntouchables == value
|| relaSign == RelaSign.GEQ && me.Controller.BoardZone.CountExceptUntouchables >= value
|| relaSign == RelaSign.LEQ && me.Controller.BoardZone.CountExceptUntouchables <= value);
-
+
public static SelfCondition IsOpBoardCount(int value, RelaSign relaSign = RelaSign.EQ)
{
return new SelfCondition(me => relaSign == RelaSign.EQ && me.Controller.Opponent.BoardZone.Count == value
|| relaSign == RelaSign.GEQ && me.Controller.Opponent.BoardZone.Count >= value
|| relaSign == RelaSign.LEQ && me.Controller.Opponent.BoardZone.Count <= value);
}
-
+ [NonSerialized]
public static readonly SelfCondition HasProperTargetsInBoard =
new SelfCondition(me => !me.Card.MustHaveTargetToPlay || me.HasAnyValidPlayTargets);
-
+ [NonSerialized]
public static readonly SelfCondition IsHeroLethalPreDamaged
= new SelfCondition(me => me is Hero hero && hero.Game.CurrentEventData.EventNumber >= hero.Health);
@@ -292,6 +357,7 @@ public static SelfCondition IsCurrentEventNumber(int value, RelaSign relaSign)
relaSign == RelaSign.GEQ ? p.Game.CurrentEventData.EventNumber >= value :
p.Game.CurrentEventData.EventNumber <= value);
}
+
public static SelfCondition IsEventTargetIs(CardType type)
{
return new SelfCondition(p => p.Game.CurrentEventData?.EventTarget.Card.Type == type);
@@ -302,7 +368,7 @@ public static SelfCondition IsEventTargetTagValue(GameTag tag, int value, RelaSi
relaSign == RelaSign.GEQ ? p.Game.CurrentEventData.EventTarget?[tag] >= value :
p.Game.CurrentEventData.EventTarget?[tag] <= value);
}
-
+
public static SelfCondition CheckThreshold(RelaSign relaSign)
{
return new SelfCondition(me =>
@@ -315,20 +381,19 @@ public static SelfCondition CheckThreshold(RelaSign relaSign)
: currentValue <= threshold;
});
}
-
+ [NonSerialized]
public static readonly SelfCondition IsEventSourceFriendly = new SelfCondition(p => p.Game.CurrentEventData.EventSource.Controller == p.Controller);
-
+ [NonSerialized]
public static readonly SelfCondition IsDefenderDead =
new SelfCondition(p => p.Game.CurrentEventData?.EventTarget.ToBeDestroyed ?? false);
-
+ [NonSerialized]
public static readonly SelfCondition IsDefenderNotDead =
new SelfCondition(p => !p.Game.CurrentEventData?.EventTarget.ToBeDestroyed ?? false);
-
public static SelfCondition IsStep(Step step)
{
return new SelfCondition(me => me.Game.Step == step);
}
-
+ [NonSerialized]
private readonly Func _function;
public SelfCondition(Func function)
diff --git a/SabberStoneCore/src/Config/GameConfig.cs b/SabberStoneCore/src/Config/GameConfig.cs
index 2dcc2b709..7365df074 100644
--- a/SabberStoneCore/src/Config/GameConfig.cs
+++ b/SabberStoneCore/src/Config/GameConfig.cs
@@ -22,6 +22,7 @@ namespace SabberStoneCore.Config
///
/// Holds all configuration values to create a new instance.
///
+ [Serializable]
public class GameConfig
{
///
diff --git a/SabberStoneCore/src/Enchants/AuraEffects.cs b/SabberStoneCore/src/Enchants/AuraEffects.cs
index 2f9120e07..b88615f69 100644
--- a/SabberStoneCore/src/Enchants/AuraEffects.cs
+++ b/SabberStoneCore/src/Enchants/AuraEffects.cs
@@ -25,6 +25,7 @@ namespace SabberStoneCore.Enchants
///
/// A simple container for saving tag value perturbations from external Auras. Call indexer to get value for a particular Tag.
///
+ [Serializable]
public class AuraEffects : IEquatable
{
private const int PlayableLength = 2;
@@ -354,6 +355,7 @@ public override int GetHashCode()
/// A collecton of controller Tag increments from Auras.
/// These tags tends to be checked when a player plays any cards.
///
+ [Serializable]
public class ControllerAuraEffects : IEquatable
{
private Action _sendHistory;
diff --git a/SabberStoneCore/src/Enchants/Effect.cs b/SabberStoneCore/src/Enchants/Effect.cs
index 0f90bbd9a..151b7db48 100644
--- a/SabberStoneCore/src/Enchants/Effect.cs
+++ b/SabberStoneCore/src/Enchants/Effect.cs
@@ -48,6 +48,7 @@ public interface IEffect
///
/// A structure for tag value variation.
///
+ [Serializable]
public readonly struct Effect : IEffect, IEquatable
{
public readonly GameTag Tag;
diff --git a/SabberStoneCore/src/Enchants/Enchant.cs b/SabberStoneCore/src/Enchants/Enchant.cs
index b2f40af27..159154dfd 100644
--- a/SabberStoneCore/src/Enchants/Enchant.cs
+++ b/SabberStoneCore/src/Enchants/Enchant.cs
@@ -27,6 +27,7 @@ namespace SabberStoneCore.Enchants
///
/// Class to store attributes of the of an Enchantment Card.
///
+ [Serializable]
public class Enchant
{
public static readonly Trigger RemoveWhenPlayedTrigger =
@@ -134,6 +135,7 @@ public void RemoveEffect(in IEntity target, int num1, int num2)
/// OngoingEnchant is narrowly used when the source of the trigger and
/// the target of the Enchantment is identical. (e.g. Mana Wyrm)
///
+ [Serializable]
public class OngoingEnchant : Enchant, IAura
{
public Game Game;
diff --git a/SabberStoneCore/src/Enchants/Enchants.cs b/SabberStoneCore/src/Enchants/Enchants.cs
index cbfbd832b..02fa29389 100644
--- a/SabberStoneCore/src/Enchants/Enchants.cs
+++ b/SabberStoneCore/src/Enchants/Enchants.cs
@@ -19,6 +19,7 @@
namespace SabberStoneCore.Enchants
{
+ [Serializable]
internal static class Enchants
{
private static Regex AttackHealth = new Regex(@"[+](\d)[/][+](\d)");
@@ -162,6 +163,7 @@ public static Enchant GetAutoEnchantFromText(string cardId)
}
+ [Serializable]
internal static class Effects
{
internal static IEffect Attack_N(int n)
diff --git a/SabberStoneCore/src/Enchants/GenericEffect.cs b/SabberStoneCore/src/Enchants/GenericEffect.cs
index 7014417b4..7ae489460 100644
--- a/SabberStoneCore/src/Enchants/GenericEffect.cs
+++ b/SabberStoneCore/src/Enchants/GenericEffect.cs
@@ -4,6 +4,7 @@
namespace SabberStoneCore.Enchants
{
+ [Serializable]
internal readonly struct GenericEffect : IEffect where TAttr : Attr where T : Playable
{
private readonly TAttr _attr;
@@ -87,6 +88,7 @@ public override string ToString()
}
}
+ [Serializable]
internal abstract class Attr where T : Playable
{
public abstract void Apply(T entity, EffectOperator @operator, int value);
@@ -98,6 +100,7 @@ internal abstract class Attr where T : Playable
protected abstract ref int GetAuraRef(AuraEffects auraEffects);
}
+ [Serializable]
internal abstract class IntAttr : Attr where T : Playable
{
protected abstract ref int? GetRef(T entity);
@@ -204,6 +207,7 @@ public override void RemoveAura(T entity, EffectOperator @operator, int value)
}
}
+ [Serializable]
internal abstract class BoolAttr : Attr where T : Playable
{
protected abstract ref bool? GetRef(T entity);
@@ -243,6 +247,7 @@ public override void RemoveAura(T entity, EffectOperator @operator, int value)
}
}
+ [Serializable]
internal abstract class SelfContainedIntAttr : IntAttr
where TSelf : SelfContainedIntAttr, new() where TTarget : Playable
{
@@ -254,6 +259,7 @@ public static GenericEffect Effect(EffectOperator @operator, int
}
}
+ [Serializable]
internal abstract class SelfContainedBoolAttr : BoolAttr
where TSelf : SelfContainedBoolAttr, new() where TTarget : Playable
{
@@ -265,6 +271,7 @@ public static GenericEffect Effect(bool value = true)
}
}
+ [Serializable]
internal class Cost : SelfContainedIntAttr
{
public override GameTag Tag => GameTag.COST;
@@ -309,6 +316,7 @@ public override void RemoveAura(Playable entity, EffectOperator @operator, int v
}
}
+ [Serializable]
internal class ATK : SelfContainedIntAttr
{
public override GameTag Tag => GameTag.ATK;
@@ -365,6 +373,7 @@ public override void Apply(Playable entity, EffectOperator @operator, int value)
//}
}
+ [Serializable]
internal class Health : SelfContainedIntAttr
{
public override GameTag Tag => GameTag.HEALTH;
@@ -417,6 +426,7 @@ public override void RemoveAura(Character entity, EffectOperator @operator, int
}
}
+ [Serializable]
internal class Stealth : SelfContainedBoolAttr
{
public override GameTag Tag => GameTag.STEALTH;
@@ -432,6 +442,7 @@ protected override ref int GetAuraRef(AuraEffects auraEffects)
}
}
+ [Serializable]
internal class Taunt : SelfContainedBoolAttr
{
public override GameTag Tag => GameTag.TAUNT;
@@ -447,6 +458,7 @@ protected override ref int GetAuraRef(AuraEffects auraEffects)
}
}
+ [Serializable]
internal class CantBeTargetedBySpells : SelfContainedBoolAttr
{
public override GameTag Tag => GameTag.CANT_BE_TARGETED_BY_SPELLS;
diff --git a/SabberStoneCore/src/Enchants/Power.cs b/SabberStoneCore/src/Enchants/Power.cs
index 61de43a82..062e5f532 100644
--- a/SabberStoneCore/src/Enchants/Power.cs
+++ b/SabberStoneCore/src/Enchants/Power.cs
@@ -12,6 +12,7 @@
// GNU Affero General Public License for more details.
#endregion
+using System;
using SabberStoneCore.Auras;
using SabberStoneCore.Enums;
using SabberStoneCore.Tasks;
@@ -20,6 +21,7 @@
namespace SabberStoneCore.Enchants
{
+ [Serializable]
public class Power
{
public string InfoCardId { get; set; } = null;
diff --git a/SabberStoneCore/src/Kettle/PowerHistory.cs b/SabberStoneCore/src/Kettle/PowerHistory.cs
index 9673619d5..c09572575 100644
--- a/SabberStoneCore/src/Kettle/PowerHistory.cs
+++ b/SabberStoneCore/src/Kettle/PowerHistory.cs
@@ -178,6 +178,7 @@ public static PowerHistoryBlockEnd BlockEnd()
// }
// repeated PowerHistoryData list = 1;
//}
+ [Serializable]
public class PowerHistory
{
public List Full { get; } = new List();
diff --git a/SabberStoneCore/src/Loader/TargetingPredicates.cs b/SabberStoneCore/src/Loader/TargetingPredicates.cs
index 3e42b72c6..cef7fcb39 100644
--- a/SabberStoneCore/src/Loader/TargetingPredicates.cs
+++ b/SabberStoneCore/src/Loader/TargetingPredicates.cs
@@ -8,6 +8,7 @@ namespace SabberStoneCore.Loader
public delegate bool AvailabilityPredicate(Controller controller, Card card);
public delegate bool TargetingPredicate(ICharacter target);
+ [Serializable]
public static class TargetingPredicates
{
private static readonly TargetingPredicate ReqMurlocTarget
diff --git a/SabberStoneCore/src/Model/Card.cs b/SabberStoneCore/src/Model/Card.cs
index 926f60af2..4322dd011 100644
--- a/SabberStoneCore/src/Model/Card.cs
+++ b/SabberStoneCore/src/Model/Card.cs
@@ -28,6 +28,7 @@ namespace SabberStoneCore.Model
/// All properties exposed by these instances are defined by `resources/Data/CardDefs.xml`.
/// for extraction procedures.
///
+ [Serializable]
public sealed class Card
{
///
diff --git a/SabberStoneCore/src/Model/Choice.cs b/SabberStoneCore/src/Model/Choice.cs
index cb426c8cb..c334ab64a 100644
--- a/SabberStoneCore/src/Model/Choice.cs
+++ b/SabberStoneCore/src/Model/Choice.cs
@@ -34,6 +34,7 @@ public enum ChoiceAction
///
///
///
+ [Serializable]
public class Choice
{
/// Initializes a new instance of the class.
diff --git a/SabberStoneCore/src/Model/Entities/Character.cs b/SabberStoneCore/src/Model/Entities/Character.cs
index 68a0573ab..6ae31982b 100644
--- a/SabberStoneCore/src/Model/Entities/Character.cs
+++ b/SabberStoneCore/src/Model/Entities/Character.cs
@@ -96,6 +96,7 @@ public partial interface ICharacter : IPlayable
///
///
///
+ [Serializable]
public abstract partial class Character : Playable, ICharacter
{
public event TriggerManager.TriggerHandler PreDamageTrigger;
diff --git a/SabberStoneCore/src/Model/Entities/Controller.cs b/SabberStoneCore/src/Model/Entities/Controller.cs
index bf1c7d24f..ee7c3190e 100644
--- a/SabberStoneCore/src/Model/Entities/Controller.cs
+++ b/SabberStoneCore/src/Model/Entities/Controller.cs
@@ -28,6 +28,7 @@ namespace SabberStoneCore.Model.Entities
/// Instance that represents a player in SabberStone game instances.
///
///
+ [Serializable]
public partial class Controller : Entity
{
private readonly int _playerId;
diff --git a/SabberStoneCore/src/Model/Entities/Enchantment.cs b/SabberStoneCore/src/Model/Entities/Enchantment.cs
index d85834c58..98595997c 100644
--- a/SabberStoneCore/src/Model/Entities/Enchantment.cs
+++ b/SabberStoneCore/src/Model/Entities/Enchantment.cs
@@ -24,6 +24,7 @@
namespace SabberStoneCore.Model.Entities
{
+ [Serializable]
public partial class Enchantment : IPlayable
{
private readonly EntityData _tags;
diff --git a/SabberStoneCore/src/Model/Entities/Entity.cs b/SabberStoneCore/src/Model/Entities/Entity.cs
index 165c2db02..2b627fd4f 100644
--- a/SabberStoneCore/src/Model/Entities/Entity.cs
+++ b/SabberStoneCore/src/Model/Entities/Entity.cs
@@ -93,6 +93,7 @@ public interface IEntity : IEnumerable>
///
///
///
+ [Serializable]
public partial class Entity : IEntity
{
///
diff --git a/SabberStoneCore/src/Model/Entities/EntityData.cs b/SabberStoneCore/src/Model/Entities/EntityData.cs
index dcb54b034..3c97395d8 100644
--- a/SabberStoneCore/src/Model/Entities/EntityData.cs
+++ b/SabberStoneCore/src/Model/Entities/EntityData.cs
@@ -26,6 +26,7 @@ namespace SabberStoneCore.Model.Entities
/// Implements .
/// This only contains modified/added tags during runtime, rather than card's original tags.
///
+ [Serializable]
internal class EntityData : IDictionary
{
private const int _initSize = 16;
diff --git a/SabberStoneCore/src/Model/Entities/EntityList.cs b/SabberStoneCore/src/Model/Entities/EntityList.cs
index bfdec5471..a33f75328 100644
--- a/SabberStoneCore/src/Model/Entities/EntityList.cs
+++ b/SabberStoneCore/src/Model/Entities/EntityList.cs
@@ -10,6 +10,7 @@ namespace SabberStoneCore.Model.Entities
/// Implements .
///
[DebuggerDisplay("Count = {_count}")]
+ [Serializable]
public class EntityList : IDictionary
{
private IPlayable[] _list;
diff --git a/SabberStoneCore/src/Model/Entities/Hero.cs b/SabberStoneCore/src/Model/Entities/Hero.cs
index b7cb9c6ad..178061a4e 100644
--- a/SabberStoneCore/src/Model/Entities/Hero.cs
+++ b/SabberStoneCore/src/Model/Entities/Hero.cs
@@ -11,6 +11,8 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using System.Collections.Generic;
using System.Text;
using SabberStoneCore.Auras;
@@ -23,6 +25,7 @@ namespace SabberStoneCore.Model.Entities
///
///
///
+ [Serializable]
public partial class Hero : Character
{
/// Gets or sets the hero power entity.
diff --git a/SabberStoneCore/src/Model/Entities/HeroPower.cs b/SabberStoneCore/src/Model/Entities/HeroPower.cs
index d97d132bd..a647bb8e6 100644
--- a/SabberStoneCore/src/Model/Entities/HeroPower.cs
+++ b/SabberStoneCore/src/Model/Entities/HeroPower.cs
@@ -11,6 +11,8 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using System.Collections.Generic;
using SabberStoneCore.Enums;
@@ -20,6 +22,7 @@ namespace SabberStoneCore.Model.Entities
/// Entity representing the special ability for a hero.
///
///
+ [Serializable]
public class HeroPower : Playable
{
/// Initializes a new instance of the class.
diff --git a/SabberStoneCore/src/Model/Entities/Minion.cs b/SabberStoneCore/src/Model/Entities/Minion.cs
index 4f72607be..9efffd8c0 100644
--- a/SabberStoneCore/src/Model/Entities/Minion.cs
+++ b/SabberStoneCore/src/Model/Entities/Minion.cs
@@ -25,6 +25,7 @@ namespace SabberStoneCore.Model.Entities
/// certain actions (provided through .
///
///
+ [Serializable]
public partial class Minion : Character
{
/// Initializes a new instance of the class.
diff --git a/SabberStoneCore/src/Model/Entities/Playable.ManageCostEffects.cs b/SabberStoneCore/src/Model/Entities/Playable.ManageCostEffects.cs
index 33c896c34..077732c62 100644
--- a/SabberStoneCore/src/Model/Entities/Playable.ManageCostEffects.cs
+++ b/SabberStoneCore/src/Model/Entities/Playable.ManageCostEffects.cs
@@ -9,6 +9,7 @@ namespace SabberStoneCore.Model.Entities
{
public partial class Playable
{
+ [Serializable]
internal class CostManager
{
private readonly List<(EffectOperator Operator, int Value)> _costEffects =
diff --git a/SabberStoneCore/src/Model/Entities/Playable.cs b/SabberStoneCore/src/Model/Entities/Playable.cs
index 340e5857c..ef1c82f4f 100644
--- a/SabberStoneCore/src/Model/Entities/Playable.cs
+++ b/SabberStoneCore/src/Model/Entities/Playable.cs
@@ -219,6 +219,7 @@ public partial interface IPlayable : IEntity
///
///
///
+ [Serializable]
public abstract partial class Playable : Entity, IPlayable
{
/// Initializes a new instance of the class.
diff --git a/SabberStoneCore/src/Model/Entities/Spell.cs b/SabberStoneCore/src/Model/Entities/Spell.cs
index be208a633..575b81219 100644
--- a/SabberStoneCore/src/Model/Entities/Spell.cs
+++ b/SabberStoneCore/src/Model/Entities/Spell.cs
@@ -11,6 +11,8 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using System.Collections.Generic;
using SabberStoneCore.Enums;
@@ -20,6 +22,7 @@ namespace SabberStoneCore.Model.Entities
/// Entity which produces a single effect when played.
///
///
+ [Serializable]
public partial class Spell : Playable
{
/// Initializes a new instance of the class.
diff --git a/SabberStoneCore/src/Model/Entities/Unknown.cs b/SabberStoneCore/src/Model/Entities/Unknown.cs
index 4d764fee7..d56254b41 100644
--- a/SabberStoneCore/src/Model/Entities/Unknown.cs
+++ b/SabberStoneCore/src/Model/Entities/Unknown.cs
@@ -17,6 +17,7 @@
namespace SabberStoneCore.Model.Entities
{
+ [Serializable]
public class Unknown : Playable
{
public static readonly Card UnknownCard = new Card("", -1,
diff --git a/SabberStoneCore/src/Model/Entities/Weapon.cs b/SabberStoneCore/src/Model/Entities/Weapon.cs
index aa06ee6d8..e0836f2e0 100644
--- a/SabberStoneCore/src/Model/Entities/Weapon.cs
+++ b/SabberStoneCore/src/Model/Entities/Weapon.cs
@@ -11,6 +11,8 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using SabberStoneCore.Enums;
using System.Collections.Generic;
@@ -22,6 +24,7 @@ namespace SabberStoneCore.Model.Entities
/// controller's hero for a limited use.
///
///
+ [Serializable]
public partial class Weapon : Playable
{
/// Initializes a new instance of the class.
diff --git a/SabberStoneCore/src/Model/Game.cs b/SabberStoneCore/src/Model/Game.cs
index 78896a58f..0a7f39a2f 100644
--- a/SabberStoneCore/src/Model/Game.cs
+++ b/SabberStoneCore/src/Model/Game.cs
@@ -52,6 +52,7 @@ namespace SabberStoneCore.Model
/// game data.
///
///
+ [Serializable]
public partial class Game : Entity
{
///
diff --git a/SabberStoneCore/src/Model/GameEventManager.cs b/SabberStoneCore/src/Model/GameEventManager.cs
index fce920c14..2856a0347 100644
--- a/SabberStoneCore/src/Model/GameEventManager.cs
+++ b/SabberStoneCore/src/Model/GameEventManager.cs
@@ -21,6 +21,7 @@ namespace SabberStoneCore.Model
/// methods when a state change is detected.
///
///
+ [Serializable]
public class GameEventManager
{
//private Game _game;
diff --git a/SabberStoneCore/src/Model/PlayHistory.cs b/SabberStoneCore/src/Model/PlayHistory.cs
index 09e88583c..325cf8b8e 100644
--- a/SabberStoneCore/src/Model/PlayHistory.cs
+++ b/SabberStoneCore/src/Model/PlayHistory.cs
@@ -11,11 +11,14 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using SabberStoneCore.Model.Entities;
using System.Text;
namespace SabberStoneCore.Model
{
+ [Serializable]
public readonly struct PlayHistoryEntry
{
public readonly int SourceController;
diff --git a/SabberStoneCore/src/Model/TaskProcessor.cs b/SabberStoneCore/src/Model/TaskProcessor.cs
index 03ed849c9..78927f8da 100644
--- a/SabberStoneCore/src/Model/TaskProcessor.cs
+++ b/SabberStoneCore/src/Model/TaskProcessor.cs
@@ -25,8 +25,10 @@
namespace SabberStoneCore.Model
{
+ [Serializable]
public class TaskQueue
{
+ [Serializable]
private class TaskInstance
{
public readonly ISimpleTask Task;
@@ -287,7 +289,7 @@ public void Clone()
}
}
-
+ [Serializable]
internal class EventMetaData
{
public IPlayable EventSource { get; set; }
diff --git a/SabberStoneCore/src/Model/TriggerManager.cs b/SabberStoneCore/src/Model/TriggerManager.cs
index 2e0c98bf0..6ea7cd3a5 100644
--- a/SabberStoneCore/src/Model/TriggerManager.cs
+++ b/SabberStoneCore/src/Model/TriggerManager.cs
@@ -13,9 +13,11 @@
#endregion
using SabberStoneCore.Enums;
using SabberStoneCore.Model.Entities;
+using System;
namespace SabberStoneCore.Model
{
+ [Serializable]
public class TriggerManager
{
public delegate void TriggerHandler(IEntity sender);
diff --git a/SabberStoneCore/src/Model/Utils.cs b/SabberStoneCore/src/Model/Utils.cs
index a63fdb0c4..db75ed0b6 100644
--- a/SabberStoneCore/src/Model/Utils.cs
+++ b/SabberStoneCore/src/Model/Utils.cs
@@ -269,6 +269,7 @@ internal static void InsertionSort(this IList list, IList keys)
}
}
+ [Serializable]
internal class PriorityQueue where TValue : struct
{
[DebuggerDisplay("{DebuggerDisplay,nq}")]
@@ -370,6 +371,7 @@ public IEnumerator GetEnumerator()
}
}
+ [Serializable]
internal class SmallFastCollection : ICollection
{
private const int InitSize = 6;
@@ -678,6 +680,7 @@ worldwide. This software is distributed without any warranty.
*/
// Modified by rnilva
+ [Serializable]
public class DeepCloneableRandom
{
private const long DOUBLE_MASK = (1L << 53) - 1;
diff --git a/SabberStoneCore/src/Model/Zones/BoardZone.cs b/SabberStoneCore/src/Model/Zones/BoardZone.cs
index 5475e6443..0d2c0dc7c 100644
--- a/SabberStoneCore/src/Model/Zones/BoardZone.cs
+++ b/SabberStoneCore/src/Model/Zones/BoardZone.cs
@@ -19,6 +19,7 @@
namespace SabberStoneCore.Model.Zones
{
+ [Serializable]
public class BoardZone : PositioningZone
{
private int _untouchableCount;
diff --git a/SabberStoneCore/src/Model/Zones/ControlledZones.cs b/SabberStoneCore/src/Model/Zones/ControlledZones.cs
index 61ce6c56b..9668a5351 100644
--- a/SabberStoneCore/src/Model/Zones/ControlledZones.cs
+++ b/SabberStoneCore/src/Model/Zones/ControlledZones.cs
@@ -26,6 +26,7 @@ namespace SabberStoneCore.Model.Zones
///
///
///
+ [Serializable]
public class ControlledZones : IEnumerable
{
/// Gets the owner of the contained zones.
diff --git a/SabberStoneCore/src/Model/Zones/DeckZone.cs b/SabberStoneCore/src/Model/Zones/DeckZone.cs
index f56568b76..c9921af0c 100644
--- a/SabberStoneCore/src/Model/Zones/DeckZone.cs
+++ b/SabberStoneCore/src/Model/Zones/DeckZone.cs
@@ -21,6 +21,7 @@
namespace SabberStoneCore.Model.Zones
{
+ [Serializable]
public class DeckZone : LimitedZone
{
public const int StartingCards = 30;
diff --git a/SabberStoneCore/src/Model/Zones/GraveyardZone.cs b/SabberStoneCore/src/Model/Zones/GraveyardZone.cs
index 1be2b5c5f..156e38458 100644
--- a/SabberStoneCore/src/Model/Zones/GraveyardZone.cs
+++ b/SabberStoneCore/src/Model/Zones/GraveyardZone.cs
@@ -12,12 +12,14 @@
// GNU Affero General Public License for more details.
#endregion
+using System;
using System.Collections.Generic;
using SabberStoneCore.Enums;
using SabberStoneCore.Model.Entities;
namespace SabberStoneCore.Model.Zones
{
+ [Serializable]
public class GraveyardZone : UnlimitedZone
{
public GraveyardZone(Controller controller) : base(controller, Zone.GRAVEYARD)
diff --git a/SabberStoneCore/src/Model/Zones/HandZone.cs b/SabberStoneCore/src/Model/Zones/HandZone.cs
index 88057eaca..004f942c8 100644
--- a/SabberStoneCore/src/Model/Zones/HandZone.cs
+++ b/SabberStoneCore/src/Model/Zones/HandZone.cs
@@ -15,12 +15,14 @@
using SabberStoneCore.Auras;
using SabberStoneCore.Enums;
using SabberStoneCore.Model.Entities;
+using System;
namespace SabberStoneCore.Model.Zones
{
///
/// Zone for all entities which are held 'in hand'.
///
+ [Serializable]
public class HandZone : PositioningZone
{
public HandZone(Controller controller) : base(Zone.HAND, Controller.MaxHandSize)
diff --git a/SabberStoneCore/src/Model/Zones/SecretZone.cs b/SabberStoneCore/src/Model/Zones/SecretZone.cs
index 4c78339c3..0177b97b9 100644
--- a/SabberStoneCore/src/Model/Zones/SecretZone.cs
+++ b/SabberStoneCore/src/Model/Zones/SecretZone.cs
@@ -20,6 +20,7 @@
namespace SabberStoneCore.Model.Zones
{
+ [Serializable]
public class SecretZone : LimitedZone
{
public const int SecretZoneMaxSize = 5;
diff --git a/SabberStoneCore/src/Model/Zones/SetasideZone.cs b/SabberStoneCore/src/Model/Zones/SetasideZone.cs
index bdf910097..8cb11e301 100644
--- a/SabberStoneCore/src/Model/Zones/SetasideZone.cs
+++ b/SabberStoneCore/src/Model/Zones/SetasideZone.cs
@@ -13,9 +13,11 @@
#endregion
using SabberStoneCore.Enums;
using SabberStoneCore.Model.Entities;
+using System;
namespace SabberStoneCore.Model.Zones
{
+ [Serializable]
public class SetasideZone : UnlimitedZone
{
public SetasideZone(Controller controller) : base(controller, Zone.SETASIDE)
diff --git a/SabberStoneCore/src/Model/Zones/Zone.cs b/SabberStoneCore/src/Model/Zones/Zone.cs
index b1eb046ca..10480e3b6 100644
--- a/SabberStoneCore/src/Model/Zones/Zone.cs
+++ b/SabberStoneCore/src/Model/Zones/Zone.cs
@@ -31,6 +31,7 @@ namespace SabberStoneCore.Model.Zones
///
///
///
+ [Serializable]
public abstract class Zone : IZone, IEnumerable where T : IPlayable
{
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
@@ -339,6 +340,7 @@ public void Dispose()
/// Base implementation of and .
/// This kind of zones never be full.
///
+ [Serializable]
public abstract class UnlimitedZone : Zone
{
protected UnlimitedZone(Controller controller, Zone type) : base(type)
@@ -433,6 +435,7 @@ private void Resize()
/// Base implementation of zones which have a maximum size.
///
///
+ [Serializable]
public abstract class LimitedZone : Zone where T: IPlayable
{
///
@@ -557,6 +560,7 @@ public override IEnumerator GetEnumerator()
/// Base implementation of zones performing strict recalculation of its containing entities' ZonePosition when any member comes and goes.
///
///
+ [Serializable]
public abstract class PositioningZone : LimitedZone where T : IPlayable
{
public readonly List Auras = new List();
diff --git a/SabberStoneCore/src/Tasks/ComplexTasks.cs b/SabberStoneCore/src/Tasks/ComplexTasks.cs
index 5d16c1d9f..92353e863 100644
--- a/SabberStoneCore/src/Tasks/ComplexTasks.cs
+++ b/SabberStoneCore/src/Tasks/ComplexTasks.cs
@@ -24,6 +24,7 @@
namespace SabberStoneCore.Tasks
{
+ [Serializable]
internal static class ComplexTask
{
public static ISimpleTask Repeat(ISimpleTask task, int times)
diff --git a/SabberStoneCore/src/Tasks/SimpleTask.cs b/SabberStoneCore/src/Tasks/SimpleTask.cs
index 62206e81b..5926f3bef 100644
--- a/SabberStoneCore/src/Tasks/SimpleTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTask.cs
@@ -27,6 +27,7 @@ TaskState Process(in Game game, in Controller controller, in IEntity source, in
bool IsTrigger { get; set; }
}
+ [Serializable]
public abstract class SimpleTask : ISimpleTask
{
public TaskState State { get; set; } = TaskState.READY;
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/ActivateDeathrattleTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/ActivateDeathrattleTask.cs
index 97574f421..0fb8f917a 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/ActivateDeathrattleTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/ActivateDeathrattleTask.cs
@@ -11,12 +11,15 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using SabberStoneCore.Enums;
using SabberStoneCore.Model;
using SabberStoneCore.Model.Entities;
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class ActivateDeathrattleTask : SimpleTask
{
private readonly EntityType _type;
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/ActivatePowerTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/ActivatePowerTask.cs
index 8d5773ed2..bfbc5f5a2 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/ActivatePowerTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/ActivatePowerTask.cs
@@ -11,12 +11,15 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using System.Collections.Generic;
using SabberStoneCore.Model;
using SabberStoneCore.Model.Entities;
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class ActivatePowerTask : SimpleTask
{
private readonly EntityType _sourceType;
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/AdaptTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/AdaptTask.cs
index 926d4edeb..68963eb90 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/AdaptTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/AdaptTask.cs
@@ -11,6 +11,8 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using System.Collections.Generic;
using System.Linq;
using SabberStoneCore.Actions;
@@ -20,6 +22,7 @@
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class AdaptTask : SimpleTask
{
//private static readonly List TotalAdaptCards = Cards.All.Where(p => p.Id.StartsWith("UNG_999t") && p.Type == CardType.SPELL).ToList();
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/AddAuraEffect.cs b/SabberStoneCore/src/Tasks/SimpleTasks/AddAuraEffect.cs
index 1ba27bbc0..a1fe61acf 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/AddAuraEffect.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/AddAuraEffect.cs
@@ -11,12 +11,15 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using SabberStoneCore.Enchants;
using SabberStoneCore.Model;
using SabberStoneCore.Model.Entities;
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class AddAuraEffect : SimpleTask
{
private readonly IEffect _effect;
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/AddCardTo.cs b/SabberStoneCore/src/Tasks/SimpleTasks/AddCardTo.cs
index 6677efc05..e54f24427 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/AddCardTo.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/AddCardTo.cs
@@ -19,6 +19,7 @@
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class AddCardTo : SimpleTask
{
private readonly int _amount;
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/AddEnchantmentTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/AddEnchantmentTask.cs
index de2f52fe8..5710f49ea 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/AddEnchantmentTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/AddEnchantmentTask.cs
@@ -11,12 +11,15 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using SabberStoneCore.Actions;
using SabberStoneCore.Model;
using SabberStoneCore.Model.Entities;
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class AddEnchantmentTask : SimpleTask
{
private readonly Card _enchantmentCard;
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/AddLackeyTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/AddLackeyTask.cs
index c4d5327a0..7a94392b1 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/AddLackeyTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/AddLackeyTask.cs
@@ -12,6 +12,7 @@
// GNU Affero General Public License for more details.
#endregion
+using System;
using System.Linq;
using SabberStoneCore.Enums;
using SabberStoneCore.Model;
@@ -19,6 +20,7 @@
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class AddLackeyTask : SimpleTask
{
public static readonly Card[]
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/AddStackTo.cs b/SabberStoneCore/src/Tasks/SimpleTasks/AddStackTo.cs
index de65b1974..839ec4ba7 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/AddStackTo.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/AddStackTo.cs
@@ -19,6 +19,7 @@
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class AddStackTo : SimpleTask
{
public AddStackTo(EntityType type)
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/ArmorTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/ArmorTask.cs
index 08fc2faf8..fe4251a96 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/ArmorTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/ArmorTask.cs
@@ -11,11 +11,14 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using SabberStoneCore.Model;
using SabberStoneCore.Model.Entities;
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class ArmorTask : SimpleTask
{
private readonly bool _useNumber;
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/AttackTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/AttackTask.cs
index bd79a50e8..6482f9ce4 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/AttackTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/AttackTask.cs
@@ -11,12 +11,15 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using SabberStoneCore.Actions;
using SabberStoneCore.Model;
using SabberStoneCore.Model.Entities;
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class AttackTask : SimpleTask
{
private readonly EntityType _aType;
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/CastRandomSpellTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/CastRandomSpellTask.cs
index bc7c5152a..0211d4636 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/CastRandomSpellTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/CastRandomSpellTask.cs
@@ -21,6 +21,7 @@
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class CastRandomSpellTask : SimpleTask
{
private static readonly ConcurrentDictionary CachedCardLists =
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/ChanceTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/ChanceTask.cs
index 94833b5cd..0d8098728 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/ChanceTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/ChanceTask.cs
@@ -11,11 +11,14 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using SabberStoneCore.Model;
using SabberStoneCore.Model.Entities;
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class ChanceTask : SimpleTask
{
public ChanceTask(bool useFlag = false)
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/ChangeAttackingTargetTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/ChangeAttackingTargetTask.cs
index afad6bd03..9ff15fa55 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/ChangeAttackingTargetTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/ChangeAttackingTargetTask.cs
@@ -11,6 +11,8 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using System.Collections.Generic;
using System.Linq;
using SabberStoneCore.Enums;
@@ -19,6 +21,7 @@
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class ChangeAttackingTargetTask : SimpleTask
{
/// The attacker
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/ChangeEntityTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/ChangeEntityTask.cs
index 48dd9f244..a7ff5d46d 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/ChangeEntityTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/ChangeEntityTask.cs
@@ -11,6 +11,8 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using System.Collections.Generic;
using SabberStoneCore.Actions;
using SabberStoneCore.Enums;
@@ -19,6 +21,7 @@
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class ChangeEntityTask : SimpleTask
{
private readonly Card _card;
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/ChangeUnidentifiedTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/ChangeUnidentifiedTask.cs
index 0a52a0e85..e95551bea 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/ChangeUnidentifiedTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/ChangeUnidentifiedTask.cs
@@ -11,12 +11,15 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using SabberStoneCore.Actions;
using SabberStoneCore.Model;
using SabberStoneCore.Model.Entities;
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class ChangeUnidentifiedTask : SimpleTask
{
public override TaskState Process(in Game game, in Controller controller, in IEntity source,
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/ClearStackTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/ClearStackTask.cs
index 8270e1963..b0e4e7b4b 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/ClearStackTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/ClearStackTask.cs
@@ -11,12 +11,15 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using System.Collections.Generic;
using SabberStoneCore.Model;
using SabberStoneCore.Model.Entities;
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class ClearStackTask : SimpleTask
{
public override TaskState Process(in Game game, in Controller controller, in IEntity source,
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/ConditionTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/ConditionTask.cs
index 399aa5b43..a4bf6ae9a 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/ConditionTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/ConditionTask.cs
@@ -20,6 +20,7 @@
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class ConditionTask : SimpleTask
{
private ConditionTask(EntityType entityType,
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/ControlTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/ControlTask.cs
index 2c3b36fa1..407de9ca2 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/ControlTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/ControlTask.cs
@@ -11,12 +11,15 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using SabberStoneCore.Enums;
using SabberStoneCore.Model;
using SabberStoneCore.Model.Entities;
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class ControlTask : SimpleTask
{
public ControlTask(EntityType type, bool opposite = false)
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/CopyCthun.cs b/SabberStoneCore/src/Tasks/SimpleTasks/CopyCthun.cs
index c5d2be836..5696f1ea6 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/CopyCthun.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/CopyCthun.cs
@@ -11,6 +11,8 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using System.Collections.Generic;
using SabberStoneCore.Enums;
using SabberStoneCore.Model;
@@ -18,6 +20,7 @@
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class CopyCthun : SimpleTask
{
public override TaskState Process(in Game game, in Controller controller, in IEntity source,
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/CopyTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/CopyTask.cs
index fc8a32870..9251fb6a9 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/CopyTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/CopyTask.cs
@@ -21,6 +21,7 @@
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class CopyTask : SimpleTask
{
private readonly EntityType _entityType;
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/CountTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/CountTask.cs
index 8dee59a1b..cde4cda79 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/CountTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/CountTask.cs
@@ -19,6 +19,7 @@
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class CountTask : SimpleTask
{
private readonly int _numberIndex;
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/DamageNumberTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/DamageNumberTask.cs
index e5f8f92d3..c8d3d1cc0 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/DamageNumberTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/DamageNumberTask.cs
@@ -11,12 +11,15 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using SabberStoneCore.Actions;
using SabberStoneCore.Model;
using SabberStoneCore.Model.Entities;
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class DamageNumberTask : SimpleTask
{
public DamageNumberTask(EntityType type, bool spellDmg = false)
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/DamageTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/DamageTask.cs
index 6cee48074..4a758ab06 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/DamageTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/DamageTask.cs
@@ -11,6 +11,8 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using System.Collections.Generic;
using SabberStoneCore.Actions;
using SabberStoneCore.Enums;
@@ -19,6 +21,7 @@
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class DamageTask : SimpleTask
{
public DamageTask(int amount, int randAmount, EntityType entityType, bool spellDmg = false)
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/DamageWeaponTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/DamageWeaponTask.cs
index 939a28a0e..75c5324a5 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/DamageWeaponTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/DamageWeaponTask.cs
@@ -11,6 +11,8 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using SabberStoneCore.Model;
using SabberStoneCore.Model.Entities;
@@ -19,6 +21,7 @@ namespace SabberStoneCore.Tasks.SimpleTasks
///
/// A task that deals specific amount of damage to one of the equipped weapons.
///
+ [Serializable]
public class DamageWeaponTask : SimpleTask
{
private readonly bool _opponent;
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/DestroyTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/DestroyTask.cs
index d17d54239..16f3cb15f 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/DestroyTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/DestroyTask.cs
@@ -11,11 +11,14 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using SabberStoneCore.Model;
using SabberStoneCore.Model.Entities;
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class DestroyTask : SimpleTask
{
private readonly bool _forcedDeathPhase;
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/DiscardTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/DiscardTask.cs
index d93ae38d2..ab2f01275 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/DiscardTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/DiscardTask.cs
@@ -11,12 +11,15 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using SabberStoneCore.Actions;
using SabberStoneCore.Model;
using SabberStoneCore.Model.Entities;
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class DiscardTask : SimpleTask
{
public DiscardTask(EntityType entityType)
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/DiscoverTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/DiscoverTask.cs
index 7f93722d0..61fa60deb 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/DiscoverTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/DiscoverTask.cs
@@ -75,6 +75,7 @@ public enum DiscoverType
HEISTBARON_TOGWAGGLE,
}
+ [Serializable]
public class DiscoverTask : SimpleTask
{
private static readonly ConcurrentDictionary
@@ -874,6 +875,7 @@ public static Card[] GetChoices(Card[][] cardsToDiscover, int numberOfChoices, U
return result;
}
+ [Serializable]
private readonly struct DiscoverCriteria : IEquatable
{
public readonly CardType CardType;
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/DrawCardTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/DrawCardTask.cs
index 4231b1e30..2dfa94c61 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/DrawCardTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/DrawCardTask.cs
@@ -11,12 +11,15 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using SabberStoneCore.Actions;
using SabberStoneCore.Model;
using SabberStoneCore.Model.Entities;
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class DrawCardTask : SimpleTask
{
public override TaskState Process(in Game game, in Controller controller, in IEntity source,
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/DrawMinionTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/DrawMinionTask.cs
index bf11a7885..0e578ae93 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/DrawMinionTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/DrawMinionTask.cs
@@ -20,6 +20,7 @@
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class DrawMinionTask : SimpleTask
{
private readonly Race _race;
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/DrawNumberTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/DrawNumberTask.cs
index 2e5ac46a6..f4d056d28 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/DrawNumberTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/DrawNumberTask.cs
@@ -11,12 +11,15 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using SabberStoneCore.Actions;
using SabberStoneCore.Model;
using SabberStoneCore.Model.Entities;
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class DrawNumberTask : SimpleTask
{
public override TaskState Process(in Game game, in Controller controller, in IEntity source,
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/DrawOpTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/DrawOpTask.cs
index 0902d0fe8..9393ae589 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/DrawOpTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/DrawOpTask.cs
@@ -11,12 +11,15 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using SabberStoneCore.Actions;
using SabberStoneCore.Model;
using SabberStoneCore.Model.Entities;
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class DrawOpTask : SimpleTask
{
public DrawOpTask(Card card = null, bool toStack = false)
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/DrawStackTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/DrawStackTask.cs
index ce4421295..de936444e 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/DrawStackTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/DrawStackTask.cs
@@ -12,12 +12,14 @@
// GNU Affero General Public License for more details.
#endregion
+using System;
using SabberStoneCore.Actions;
using SabberStoneCore.Model;
using SabberStoneCore.Model.Entities;
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class DrawStackTask : SimpleTask
{
public override TaskState Process(in Game game, in Controller controller, in IEntity source,
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/DrawTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/DrawTask.cs
index 9c86c5dc5..94f91461b 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/DrawTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/DrawTask.cs
@@ -11,6 +11,8 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using System.Collections.Generic;
using SabberStoneCore.Actions;
using SabberStoneCore.Model;
@@ -18,6 +20,7 @@
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class DrawTask : SimpleTask
{
private readonly int _count;
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/EnqueueNumberTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/EnqueueNumberTask.cs
index 8d952750f..545ff8f38 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/EnqueueNumberTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/EnqueueNumberTask.cs
@@ -1,4 +1,5 @@
-using SabberStoneCore.Model;
+using System;
+using SabberStoneCore.Model;
#region copyright
// SabberStone, Hearthstone Simulator in C# .NET Core
// Copyright (C) 2017-2019 SabberStone Team, darkfriend77 & rnilva
@@ -17,6 +18,7 @@
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class EnqueueNumberTask : SimpleTask
{
private readonly bool _spellDmg;
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/EnqueueTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/EnqueueTask.cs
index f8bd74519..5c580ec93 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/EnqueueTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/EnqueueTask.cs
@@ -12,6 +12,7 @@
// GNU Affero General Public License for more details.
#endregion
+using System;
using System.Collections.Generic;
using SabberStoneCore.Actions;
using SabberStoneCore.Model;
@@ -19,6 +20,7 @@
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class EnqueueTask : SimpleTask
{
private readonly int _amount;
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/ExtraTurnEffectTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/ExtraTurnEffectTask.cs
index a94ff0fcb..a81f9e202 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/ExtraTurnEffectTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/ExtraTurnEffectTask.cs
@@ -17,6 +17,7 @@
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class ExtraTurnEffectTask : SimpleTask
{
//private readonly bool _opposite;
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/FilterTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/FilterTask.cs
index f495b5ac0..7d10504ea 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/FilterTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/FilterTask.cs
@@ -11,6 +11,8 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using System.Collections.Generic;
using SabberStoneCore.Conditions;
using SabberStoneCore.Enums;
@@ -19,6 +21,7 @@
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class FilterStackTask : SimpleTask
{
private readonly RelaCondition[] _relaConditions;
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/FlagTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/FlagTask.cs
index b3636ac62..1f99f5451 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/FlagTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/FlagTask.cs
@@ -11,11 +11,14 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using SabberStoneCore.Model;
using SabberStoneCore.Model.Entities;
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class FlagTask : SimpleTask
{
private readonly bool _checkFlag;
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/FuncNumberTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/FuncNumberTask.cs
index 7fe053814..5d731ab72 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/FuncNumberTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/FuncNumberTask.cs
@@ -18,6 +18,7 @@
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class FuncNumberTask : SimpleTask
{
private readonly Action _action;
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/FuncPlayablesTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/FuncPlayablesTask.cs
index 563ef07ea..2a20c595c 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/FuncPlayablesTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/FuncPlayablesTask.cs
@@ -18,6 +18,7 @@
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class FuncPlayablesTask : SimpleTask
{
public FuncPlayablesTask(Func, IList> function)
@@ -40,6 +41,7 @@ public override TaskState Process(in Game game, in Controller controller, in IEn
}
}
+ [Serializable]
public class CustomTask : SimpleTask
{
private readonly Action _func;
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/GetCapturedCardTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/GetCapturedCardTask.cs
index f979ea436..9c4e7de60 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/GetCapturedCardTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/GetCapturedCardTask.cs
@@ -7,6 +7,7 @@ namespace SabberStoneCore.Tasks.SimpleTasks
///
/// Creates new entity instance from the captured Card of an Enchantment.
///
+ [Serializable]
public class GetCapturedCardTask : SimpleTask
{
private GetCapturedCardTask() { }
@@ -42,6 +43,7 @@ public override TaskState Process(in Game game, in Controller controller, in IEn
///
/// Activates the captured card's Deathrattle Task.
///
+ [Serializable]
public class ActivateCapturedDeathrattleTask : SimpleTask
{
private ActivateCapturedDeathrattleTask() { }
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/GetControllerManaTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/GetControllerManaTask.cs
index 4d00be3c9..1e61ba57c 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/GetControllerManaTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/GetControllerManaTask.cs
@@ -11,11 +11,14 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using SabberStoneCore.Model;
using SabberStoneCore.Model.Entities;
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class GetControllerManaTask : SimpleTask
{
public override TaskState Process(in Game game, in Controller controller, in IEntity source,
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/GetGameTagControllerTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/GetGameTagControllerTask.cs
index 7ec6558ef..dd982382d 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/GetGameTagControllerTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/GetGameTagControllerTask.cs
@@ -11,12 +11,15 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using SabberStoneCore.Enums;
using SabberStoneCore.Model;
using SabberStoneCore.Model.Entities;
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class GetGameTagControllerTask : SimpleTask
{
public GetGameTagControllerTask(GameTag tag)
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/GetGameTagGameTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/GetGameTagGameTask.cs
index eca76cbe3..f26ad71eb 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/GetGameTagGameTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/GetGameTagGameTask.cs
@@ -11,12 +11,15 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using SabberStoneCore.Enums;
using SabberStoneCore.Model;
using SabberStoneCore.Model.Entities;
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class GetGameTagGameTask : SimpleTask
{
public GetGameTagGameTask(GameTag tag)
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/GetGameTagTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/GetGameTagTask.cs
index 5525fcde4..4c275d607 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/GetGameTagTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/GetGameTagTask.cs
@@ -19,6 +19,7 @@
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class GetGameTagTask : SimpleTask
{
public GetGameTagTask(GameTag tag, EntityType entityType, int entityIndex = 0, int numberIndex = 0)
@@ -97,6 +98,7 @@ public override TaskState Process(in Game game, in Controller controller, in IEn
/// Gets number of the current event and stores it to the stack.
/// (e.g. the amount damage dealt or heal taken)
///
+ [Serializable]
public class GetEventNumberTask : SimpleTask
{
private readonly int _numberIndex;
@@ -135,6 +137,7 @@ public override TaskState Process(in Game game, in Controller controller, in IEn
}
}
+ [Serializable]
public class SetEventNumberTask : SimpleTask
{
private readonly int _num;
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/HealFullTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/HealFullTask.cs
index 3f7e4661c..3afec1232 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/HealFullTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/HealFullTask.cs
@@ -11,11 +11,14 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using SabberStoneCore.Model;
using SabberStoneCore.Model.Entities;
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class HealFullTask : SimpleTask
{
public HealFullTask(EntityType entityType)
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/HealNumberTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/HealNumberTask.cs
index eae18e44f..a53d4dfd7 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/HealNumberTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/HealNumberTask.cs
@@ -11,11 +11,14 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using SabberStoneCore.Model;
using SabberStoneCore.Model.Entities;
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class HealNumberTask : SimpleTask
{
public HealNumberTask(EntityType entityType)
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/HealTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/HealTask.cs
index f475c3514..6d158d286 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/HealTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/HealTask.cs
@@ -11,11 +11,14 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using SabberStoneCore.Model;
using SabberStoneCore.Model.Entities;
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class HealTask : SimpleTask
{
public HealTask(int amount, EntityType entityType)
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/IncludeTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/IncludeTask.cs
index f08f57f0f..c90003c0d 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/IncludeTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/IncludeTask.cs
@@ -200,6 +200,7 @@ public enum EntityType
DISCARDED
}
+ [Serializable]
public class IncludeTask : SimpleTask
{
private const int SingleTypesRange = 9;
@@ -427,6 +428,7 @@ public static IList GetEntities(in EntityType type, in Controller c,
}
}
+ [Serializable]
public class IncludeAdjacentTask : SimpleTask
{
private readonly EntityType _type;
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/MagneticTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/MagneticTask.cs
index 848fe9111..fb1034add 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/MagneticTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/MagneticTask.cs
@@ -11,6 +11,8 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using SabberStoneCore.Actions;
using SabberStoneCore.Enums;
using SabberStoneCore.Model;
@@ -19,6 +21,7 @@
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class MagneticTask : SimpleTask
{
public override TaskState Process(in Game game, in Controller controller, in IEntity source,
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/ManaCrystalTasks.cs b/SabberStoneCore/src/Tasks/SimpleTasks/ManaCrystalTasks.cs
index e051b0de1..41b724f5b 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/ManaCrystalTasks.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/ManaCrystalTasks.cs
@@ -11,6 +11,8 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using SabberStoneCore.Actions;
using SabberStoneCore.Kettle;
using SabberStoneCore.Model;
@@ -18,6 +20,7 @@
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class ManaCrystalFullTask : SimpleTask
{
private readonly bool _both;
@@ -42,6 +45,7 @@ public override TaskState Process(in Game game, in Controller controller, in IEn
}
}
+ [Serializable]
public class ManaCrystalEmptyTask : SimpleTask
{
private readonly int _amount;
@@ -67,6 +71,7 @@ public override TaskState Process(in Game game, in Controller controller, in IEn
}
}
+ [Serializable]
public class ManaCrystalSetTask : SimpleTask
{
private readonly int _amount;
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/MathTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/MathTask.cs
index 195f0c76f..c087adc22 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/MathTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/MathTask.cs
@@ -26,6 +26,7 @@ public enum MathOperation
DIV
}
+ [Serializable]
public class MathNumberIndexTask : SimpleTask
{
private readonly int _indexA;
@@ -110,6 +111,7 @@ private static int GetNumber(in int index, in TaskStack stack)
}
}
+ [Serializable]
public class MathRandTask : SimpleTask
{
public MathRandTask(int min, int max)
@@ -130,6 +132,7 @@ public override TaskState Process(in Game game, in Controller controller, in IEn
}
}
+ [Serializable]
public class MathMultiplyTask : SimpleTask
{
public MathMultiplyTask(int amount)
@@ -148,6 +151,7 @@ public override TaskState Process(in Game game, in Controller controller, in IEn
}
}
+ [Serializable]
public class MathAddTask : SimpleTask
{
public MathAddTask(int amount)
@@ -166,6 +170,7 @@ public override TaskState Process(in Game game, in Controller controller, in IEn
}
}
+ [Serializable]
public class MathSubstractionTask : SimpleTask
{
public MathSubstractionTask(int amount)
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/MoveToDeck.cs b/SabberStoneCore/src/Tasks/SimpleTasks/MoveToDeck.cs
index aa5bde9a7..bbec7ac14 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/MoveToDeck.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/MoveToDeck.cs
@@ -11,6 +11,8 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using SabberStoneCore.Actions;
using SabberStoneCore.Enums;
using SabberStoneCore.Model;
@@ -18,6 +20,7 @@
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class MoveToDeck : SimpleTask
{
private readonly EntityType _type;
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/MoveToGraveYard.cs b/SabberStoneCore/src/Tasks/SimpleTasks/MoveToGraveYard.cs
index 5b321240f..e05adf0aa 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/MoveToGraveYard.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/MoveToGraveYard.cs
@@ -11,12 +11,15 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using SabberStoneCore.Enums;
using SabberStoneCore.Model;
using SabberStoneCore.Model.Entities;
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class MoveToGraveYard : SimpleTask
{
public MoveToGraveYard(EntityType type)
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/MoveToSetaside.cs b/SabberStoneCore/src/Tasks/SimpleTasks/MoveToSetaside.cs
index aff5c3c0d..fc61bb899 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/MoveToSetaside.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/MoveToSetaside.cs
@@ -11,12 +11,15 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using SabberStoneCore.Enums;
using SabberStoneCore.Model;
using SabberStoneCore.Model.Entities;
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class MoveToSetaside : SimpleTask
{
public MoveToSetaside(EntityType type)
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/MoveWeaponToSetaside.cs b/SabberStoneCore/src/Tasks/SimpleTasks/MoveWeaponToSetaside.cs
index dbc219b82..126ab0df5 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/MoveWeaponToSetaside.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/MoveWeaponToSetaside.cs
@@ -11,6 +11,8 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using SabberStoneCore.Enums;
using SabberStoneCore.Model;
using SabberStoneCore.Model.Entities;
@@ -20,6 +22,7 @@ namespace SabberStoneCore.Tasks.SimpleTasks
///
/// Removing the Weapon from the hero. Without triggering deathrattle event.
///
+ [Serializable]
public class MoveWeaponToSetaside : SimpleTask
{
public override TaskState Process(in Game game, in Controller controller, in IEntity source,
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/PlayTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/PlayTask.cs
index 1700aca42..3b8c77d8e 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/PlayTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/PlayTask.cs
@@ -27,6 +27,7 @@ public enum PlayType
///
/// Allows to have a playable played out in a task
///
+ [Serializable]
public class PlayTask : SimpleTask
{
private readonly PlayType _playType;
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/PotionGenerating.cs b/SabberStoneCore/src/Tasks/SimpleTasks/PotionGenerating.cs
index d180d156b..24875e4a2 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/PotionGenerating.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/PotionGenerating.cs
@@ -22,6 +22,7 @@
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
internal static class KazakusPower
{
private static readonly Card[][] PotionCards;
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/QuestProgressTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/QuestProgressTask.cs
index 513e9240a..3d83d6e28 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/QuestProgressTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/QuestProgressTask.cs
@@ -12,6 +12,7 @@
// GNU Affero General Public License for more details.
#endregion
+using System;
using SabberStoneCore.Actions;
using SabberStoneCore.Enums;
using SabberStoneCore.Model;
@@ -19,6 +20,7 @@
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class QuestProgressTask : SimpleTask
{
//private readonly string _questRewardId;
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/RandomCardTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/RandomCardTask.cs
index 23288274c..28a092b92 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/RandomCardTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/RandomCardTask.cs
@@ -21,6 +21,7 @@
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class RandomCardTask : SimpleTask
{
private static readonly ConcurrentDictionary<(int, CardClass), Card[]> CachedCardLists =
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/RandomEntourageCardTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/RandomEntourageCardTask.cs
index 99f040cec..ea03af3de 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/RandomEntourageCardTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/RandomEntourageCardTask.cs
@@ -18,6 +18,7 @@
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class RandomEntourageTask : SimpleTask
{
private readonly int _count;
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/RandomMinionNumberTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/RandomMinionNumberTask.cs
index f14665132..90ac4641d 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/RandomMinionNumberTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/RandomMinionNumberTask.cs
@@ -11,6 +11,8 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using System.Collections.Generic;
using System.Linq;
using SabberStoneCore.Enums;
@@ -19,6 +21,7 @@
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class RandomMinionNumberTask : SimpleTask
{
public RandomMinionNumberTask(GameTag tag)
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/RandomMinionTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/RandomMinionTask.cs
index 1bac9a176..1cf9d42e8 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/RandomMinionTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/RandomMinionTask.cs
@@ -21,6 +21,7 @@
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class RandomMinionTask : SimpleTask
{
private static readonly ConcurrentDictionary> CachedCards =
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/RandomTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/RandomTask.cs
index 91e1a93fe..c60a2e4d4 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/RandomTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/RandomTask.cs
@@ -11,12 +11,15 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using System.Collections.Generic;
using SabberStoneCore.Model;
using SabberStoneCore.Model.Entities;
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class SplitTask : SimpleTask
{
public SplitTask(int amount, EntityType type)
@@ -83,6 +86,7 @@ public override TaskState Process(in Game game, in Controller controller, in IEn
}
}
+ [Serializable]
public class RandomTask : SimpleTask
{
private readonly int _amount;
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/RecruitTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/RecruitTask.cs
index 37c3fd2f0..02b76388d 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/RecruitTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/RecruitTask.cs
@@ -20,6 +20,7 @@
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class RecruitTask : SimpleTask
{
private readonly SelfCondition[] _conditions;
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/RemoveEnchantmentTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/RemoveEnchantmentTask.cs
index ccea3403f..9c3255973 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/RemoveEnchantmentTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/RemoveEnchantmentTask.cs
@@ -19,6 +19,7 @@
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
// Remove applied effects of this enchantment
public class RemoveEnchantmentTask : SimpleTask
{
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/RemoveFromDeck.cs b/SabberStoneCore/src/Tasks/SimpleTasks/RemoveFromDeck.cs
index 31fcbc8cd..02565a2c3 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/RemoveFromDeck.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/RemoveFromDeck.cs
@@ -12,6 +12,7 @@
// GNU Affero General Public License for more details.
#endregion
+using System;
using System.Collections.Generic;
using System.Linq;
using SabberStoneCore.Actions;
@@ -22,6 +23,7 @@
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class RemoveFromDeck : SimpleTask
{
private readonly EntityType _type;
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/RemoveFromHand.cs b/SabberStoneCore/src/Tasks/SimpleTasks/RemoveFromHand.cs
index 3fc801c69..966cffc6b 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/RemoveFromHand.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/RemoveFromHand.cs
@@ -11,6 +11,8 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using System.Collections.Generic;
using SabberStoneCore.Actions;
using SabberStoneCore.Enums;
@@ -19,6 +21,7 @@
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class RemoveFromHand : SimpleTask
{
public RemoveFromHand(EntityType type)
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/ReplaceHeroPower.cs b/SabberStoneCore/src/Tasks/SimpleTasks/ReplaceHeroPower.cs
index 8359ea81b..e2acea103 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/ReplaceHeroPower.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/ReplaceHeroPower.cs
@@ -11,12 +11,15 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using SabberStoneCore.Enums;
using SabberStoneCore.Model;
using SabberStoneCore.Model.Entities;
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class ReplaceHeroPower : SimpleTask
{
private readonly Card _heroPowerCard;
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/ReplaceHeroTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/ReplaceHeroTask.cs
index 4a6a0c655..030d1f1e5 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/ReplaceHeroTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/ReplaceHeroTask.cs
@@ -11,11 +11,14 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using SabberStoneCore.Model;
using SabberStoneCore.Model.Entities;
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class ReplaceHeroTask : SimpleTask
{
private readonly Card _heroCard;
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/ReplaceTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/ReplaceTask.cs
index 2563c1f87..4b1e73e81 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/ReplaceTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/ReplaceTask.cs
@@ -11,6 +11,8 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using System.Collections.Generic;
using System.Linq;
using SabberStoneCore.Enums;
@@ -20,6 +22,7 @@
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class ReplaceTask : SimpleTask
{
public ReplaceTask(EntityType type, Rarity rarity)
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/ReplaceWeaponTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/ReplaceWeaponTask.cs
index e9ee27d4d..c4168e14b 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/ReplaceWeaponTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/ReplaceWeaponTask.cs
@@ -11,11 +11,14 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using SabberStoneCore.Model;
using SabberStoneCore.Model.Entities;
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class ReplaceWeaponTask : SimpleTask
{
private readonly Card _weaponCard;
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/ReturnHandTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/ReturnHandTask.cs
index 5dc2b60c2..29b8200ad 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/ReturnHandTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/ReturnHandTask.cs
@@ -11,12 +11,15 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using SabberStoneCore.Actions;
using SabberStoneCore.Model;
using SabberStoneCore.Model.Entities;
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class ReturnHandTask : SimpleTask
{
public ReturnHandTask(EntityType type)
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/RevealStealthTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/RevealStealthTask.cs
index 79fbd4512..29796e6a7 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/RevealStealthTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/RevealStealthTask.cs
@@ -11,6 +11,8 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using SabberStoneCore.Model;
using SabberStoneCore.Model.Entities;
@@ -19,6 +21,7 @@ namespace SabberStoneCore.Tasks.SimpleTasks
///
/// Reveals the target(s), effectively removing their stealth attribute.
///
+ [Serializable]
public class RevealStealthTask : SimpleTask
{
public RevealStealthTask(EntityType type)
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/RevealTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/RevealTask.cs
index 79034be01..35358d881 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/RevealTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/RevealTask.cs
@@ -11,6 +11,8 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using SabberStoneCore.Actions;
using SabberStoneCore.Enums;
using SabberStoneCore.Kettle;
@@ -19,6 +21,7 @@
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class RevealTask : SimpleTask
{
private readonly ISimpleTask _failedJoustTask;
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/RitualTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/RitualTask.cs
index 10aa24d17..c32ae7fae 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/RitualTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/RitualTask.cs
@@ -11,6 +11,8 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using System.Collections.Generic;
using SabberStoneCore.Actions;
using SabberStoneCore.Enchants;
@@ -20,6 +22,7 @@
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class RitualTask : SimpleTask
{
public enum RitualType
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/SetControllerGameTagTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/SetControllerGameTagTask.cs
index b36b6bb36..36d1017c8 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/SetControllerGameTagTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/SetControllerGameTagTask.cs
@@ -11,12 +11,15 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using SabberStoneCore.Enums;
using SabberStoneCore.Model;
using SabberStoneCore.Model.Entities;
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class SetControllerGameTagTask : SimpleTask
{
public SetControllerGameTagTask(GameTag tag, int amount, bool opFlag = false)
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/SetGameTagNumberTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/SetGameTagNumberTask.cs
index 767c3fee4..1db4c89fa 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/SetGameTagNumberTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/SetGameTagNumberTask.cs
@@ -11,12 +11,15 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using SabberStoneCore.Enums;
using SabberStoneCore.Model;
using SabberStoneCore.Model.Entities;
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class SetGameTagNumberTask : SimpleTask
{
public SetGameTagNumberTask(GameTag tag, EntityType entityType, bool ignoreDamage = false)
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/SetGameTagTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/SetGameTagTask.cs
index 7315afdd5..96ed3a92d 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/SetGameTagTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/SetGameTagTask.cs
@@ -11,6 +11,8 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using SabberStoneCore.Enchants;
using SabberStoneCore.Enums;
using SabberStoneCore.Model;
@@ -18,6 +20,7 @@
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class SetGameTagTask : SimpleTask
{
public SetGameTagTask(GameTag tag, int amount, EntityType entityType)
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/SetNativeGameTagTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/SetNativeGameTagTask.cs
index 04542947e..74731c0ab 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/SetNativeGameTagTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/SetNativeGameTagTask.cs
@@ -11,6 +11,8 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using System.Collections.Generic;
using SabberStoneCore.Enums;
using SabberStoneCore.Model;
@@ -18,6 +20,7 @@
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class SetNativeGameTagTask : SimpleTask
{
public SetNativeGameTagTask(GameTag tag, int value, EntityType entityType)
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/SilenceTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/SilenceTask.cs
index 9819b1645..efbd36bd3 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/SilenceTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/SilenceTask.cs
@@ -11,11 +11,14 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using SabberStoneCore.Model;
using SabberStoneCore.Model.Entities;
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class SilenceTask : SimpleTask
{
public SilenceTask(EntityType type)
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/SummonCopyTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/SummonCopyTask.cs
index 4bc42dbd1..d59f40ab0 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/SummonCopyTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/SummonCopyTask.cs
@@ -11,6 +11,8 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using System.Collections.Generic;
using SabberStoneCore.Actions;
using SabberStoneCore.Enums;
@@ -25,6 +27,7 @@ namespace SabberStoneCore.Tasks.SimpleTasks
/// Summon a copy of one (or more) existing entity.
///
///
+ [Serializable]
public class SummonCopyTask : SimpleTask
{
private readonly bool _addToStack;
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/SummonOpTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/SummonOpTask.cs
index db3696c39..5cbc8fb21 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/SummonOpTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/SummonOpTask.cs
@@ -11,12 +11,15 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using SabberStoneCore.Actions;
using SabberStoneCore.Model;
using SabberStoneCore.Model.Entities;
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class SummonOpTask : SimpleTask
{
private readonly Card _card;
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/SummonStackTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/SummonStackTask.cs
index 82cb51c57..e2efcc38c 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/SummonStackTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/SummonStackTask.cs
@@ -11,6 +11,8 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using SabberStoneCore.Actions;
using SabberStoneCore.Model;
using SabberStoneCore.Model.Entities;
@@ -21,6 +23,7 @@ namespace SabberStoneCore.Tasks.SimpleTasks
/// Summon minions included in the stack.
///
///
+ [Serializable]
public class SummonStackTask : SimpleTask
{
public SummonStackTask(bool removeFromZone = false, bool removeFromStack = false)
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/SummonTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/SummonTask.cs
index 643ea1b05..9a444e61c 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/SummonTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/SummonTask.cs
@@ -43,6 +43,7 @@ public enum SummonSide
ALTERNATE
}
+ [Serializable]
public class SummonTask : SimpleTask
{
private readonly bool _addToStack;
@@ -196,6 +197,7 @@ public static int GetPosition(in IEntity source, in SummonSide side, in int numb
}
}
+ [Serializable]
public class SummonNumberTask : SimpleTask
{
private readonly Card _card;
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/SwapAttackHealthTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/SwapAttackHealthTask.cs
index 00b8db015..bf22df6da 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/SwapAttackHealthTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/SwapAttackHealthTask.cs
@@ -11,6 +11,8 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using System.Collections.Generic;
using SabberStoneCore.Enchants;
using SabberStoneCore.Enums;
@@ -19,6 +21,7 @@
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class SwapAttackHealthTask : SimpleTask
{
private readonly Card _enchantmentCard;
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/TempManaTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/TempManaTask.cs
index d0107e974..b848f4ddb 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/TempManaTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/TempManaTask.cs
@@ -11,12 +11,15 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using SabberStoneCore.Actions;
using SabberStoneCore.Model;
using SabberStoneCore.Model.Entities;
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class TempManaTask : SimpleTask
{
public TempManaTask(int amount)
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/TransformCopyTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/TransformCopyTask.cs
index 9e97aa9de..0d4667394 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/TransformCopyTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/TransformCopyTask.cs
@@ -11,6 +11,8 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using System.Collections.Generic;
using SabberStoneCore.Actions;
using SabberStoneCore.Auras;
@@ -22,6 +24,7 @@
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class TransformCopyTask : SimpleTask
{
private readonly bool _addToStack;
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/TransformRandomTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/TransformRandomTask.cs
index 90281883f..4a60bfb1f 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/TransformRandomTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/TransformRandomTask.cs
@@ -11,6 +11,8 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using System.Collections.Generic;
using SabberStoneCore.Actions;
using SabberStoneCore.Model;
@@ -18,6 +20,7 @@
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class TransformMinionTask : SimpleTask
{
public TransformMinionTask(EntityType type, int costChange)
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/TransformTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/TransformTask.cs
index 1bbef7aaa..d9afe971c 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/TransformTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/TransformTask.cs
@@ -12,6 +12,7 @@
// GNU Affero General Public License for more details.
#endregion
+using System;
using System.Collections.Generic;
using SabberStoneCore.Actions;
using SabberStoneCore.Model;
@@ -19,6 +20,7 @@
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class TransformTask : SimpleTask
{
private readonly Card _card;
diff --git a/SabberStoneCore/src/Tasks/SimpleTasks/WeaponTask.cs b/SabberStoneCore/src/Tasks/SimpleTasks/WeaponTask.cs
index f000cbc39..c398d7a5f 100644
--- a/SabberStoneCore/src/Tasks/SimpleTasks/WeaponTask.cs
+++ b/SabberStoneCore/src/Tasks/SimpleTasks/WeaponTask.cs
@@ -11,12 +11,15 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using SabberStoneCore.Actions;
using SabberStoneCore.Model;
using SabberStoneCore.Model.Entities;
namespace SabberStoneCore.Tasks.SimpleTasks
{
+ [Serializable]
public class WeaponTask : SimpleTask
{
private readonly Card _card;
diff --git a/SabberStoneCore/src/Tasks/StateTaskList.cs b/SabberStoneCore/src/Tasks/StateTaskList.cs
index 277682e54..df245f5f3 100644
--- a/SabberStoneCore/src/Tasks/StateTaskList.cs
+++ b/SabberStoneCore/src/Tasks/StateTaskList.cs
@@ -11,6 +11,8 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using System.Diagnostics;
using System.Text;
using SabberStoneCore.Model;
@@ -25,6 +27,7 @@ public enum TaskState
[DebuggerDisplay("{DebuggerDisplay, nq}")]
+ [Serializable]
public class StateTaskList : ISimpleTask
{
private readonly ISimpleTask[] _tasks;
diff --git a/SabberStoneCore/src/Triggers/MultiTrigger.cs b/SabberStoneCore/src/Triggers/MultiTrigger.cs
index 210c9252f..674af1ecc 100644
--- a/SabberStoneCore/src/Triggers/MultiTrigger.cs
+++ b/SabberStoneCore/src/Triggers/MultiTrigger.cs
@@ -11,6 +11,8 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
#endregion
+
+using System;
using System.Collections;
using System.Collections.Generic;
using SabberStoneCore.Enums;
@@ -18,6 +20,7 @@
namespace SabberStoneCore.Triggers
{
+ [Serializable]
public class MultiTrigger : Trigger, IReadOnlyList
{
private readonly IReadOnlyList _triggers;
diff --git a/SabberStoneCore/src/Triggers/Trigger.cs b/SabberStoneCore/src/Triggers/Trigger.cs
index 6efb5da6a..cc78e7a5f 100644
--- a/SabberStoneCore/src/Triggers/Trigger.cs
+++ b/SabberStoneCore/src/Triggers/Trigger.cs
@@ -21,6 +21,7 @@
namespace SabberStoneCore.Triggers
{
+ [Serializable]
public class Trigger
{
private readonly TriggerManager.TriggerHandler _processHandler;