Example #1
0
 protected TagMatchCondition(IDeserializer deserializer)
     : base(deserializer)
 {
     MatchScopes  = deserializer.GetValue <TagScope>(nameof(MatchScopes));
     MatchKey     = deserializer.GetValue <string>(nameof(MatchKey));
     KeyMatchKind = deserializer.GetValue <MatchKind>(nameof(KeyMatchKind));
 }
Example #2
0
 private Result(IDeserializer deserializer)
 {
     Name    = deserializer.GetValue <string>(nameof(Name));
     Key     = deserializer.GetValue <string>(nameof(Key));
     Effects = deserializer.GetValues <EffectBase>(nameof(Effects)).EmptyIfNull().ToList().AsReadOnly();
     Tags    = new TagCollection(deserializer.GetValue <IEnumerable <TagBase> >(nameof(Tags)), this);
 }
 private CopyTagsEffect(IDeserializer deserializer)
     : base(deserializer)
 {
     TagKey             = deserializer.GetValue <string>(nameof(TagKey));
     TagScope           = deserializer.GetValue <TagScope>(nameof(TagScope));
     TagKeyMatchKind    = deserializer.GetValue <MatchKind>(nameof(TagKeyMatchKind));
     NewTagKey          = deserializer.GetValue <string>(nameof(NewTagKey));
     ConflictResolution = deserializer.GetValue <KeyConflictResolutionKind>(nameof(ConflictResolution));
 }
 private EntityRules(IDeserializer deserializer)
 {
     ActionMatrix         = new Dictionary <ActionMatrixEntryKey, ActionMatrixEntry>();
     Name                 = deserializer.GetValue <string>(nameof(Name));
     StringLookup         = deserializer.GetValue <StringLookup>("Lookup");
     PreBattleEffects     = deserializer.GetValues <EffectBase>(nameof(PreBattleEffects)).ToList().AsReadOnly();
     PostBattleEffects    = deserializer.GetValues <EffectBase>(nameof(PostBattleEffects)).EmptyIfNull().ToList().AsReadOnly();
     PreTurnEffects       = deserializer.GetValues <EffectBase>(nameof(PreTurnEffects)).EmptyIfNull().ToList().AsReadOnly();
     PostTurnEffects      = deserializer.GetValues <EffectBase>(nameof(PostTurnEffects)).EmptyIfNull().ToList().AsReadOnly();
     EliminationCondition = deserializer.GetValue <ConditionBase>(nameof(EliminationCondition));
     Actions              = deserializer.GetValues <Action>(nameof(Actions)).EmptyIfNull().ToList().AsReadOnly();
     Results              = deserializer.GetValues <Result>(nameof(Results)).EmptyIfNull().ToList().AsReadOnly();
     ActionMatrix         = deserializer.GetValues <ActionMatrixEntry>(nameof(ActionMatrix)).EmptyIfNull().ToDictionary(x => x.Key, x => x);
 }
Example #5
0
 private BattleRules(IDeserializer deserializer)
 {
     PreBattleEffects     = deserializer.GetValues <EffectBase>(nameof(PreBattleEffects)).ToList().AsReadOnly();
     PostBattleEffects    = deserializer.GetValues <EffectBase>(nameof(PostBattleEffects)).EmptyIfNull().ToList().AsReadOnly();
     PreTurnEffects       = deserializer.GetValues <EffectBase>(nameof(PreTurnEffects)).EmptyIfNull().ToList().AsReadOnly();
     PostTurnEffects      = deserializer.GetValues <EffectBase>(nameof(PostTurnEffects)).EmptyIfNull().ToList().AsReadOnly();
     EliminationCondition = deserializer.GetValue <ConditionBase>(nameof(EliminationCondition));
 }
Example #6
0
        public static ISerializable Deserialize(IDeserializer deserializer)
        {
            var name = deserializer.GetValue <string>("$");
            Func <IDeserializer, ISerializable> deserialize;

            lock (s_lock)
                deserialize = s_deserializers.GetValueOrDefault(name);
            if (deserialize == null)
            {
                throw new SerializationFormatException($"Attempted to deserialize unknown type: {name}");
            }
            return(deserialize(deserializer));
        }
Example #7
0
 private AddTagEffect(IDeserializer deserializer)
     : base(deserializer)
 {
     Tag = deserializer.GetValue <TagBase>(nameof(Tag));
     ConflictResolution = deserializer.GetValue <KeyConflictResolutionKind>(nameof(ConflictResolution));
 }
Example #8
0
 private StringValueTag(IDeserializer deserializer)
     : base(deserializer)
 {
     Value = deserializer.GetValue <string>(nameof(Value));
 }
 private Action(IDeserializer deserializer)
 {
     Key  = deserializer.GetValue <string>(nameof(Key));
     Name = deserializer.GetValue <string>(nameof(Name));
     Tags = new TagCollection(deserializer.GetValue <IEnumerable <TagBase> >(nameof(Tags)), this);
 }
 private IntValueTag(IDeserializer deserializer)
     : base(deserializer)
 {
     Value = deserializer.GetValue <int?>(nameof(Value));
 }
 private ConditionalTagsTag(IDeserializer deserializer)
     : base(deserializer)
 {
     Tags = new TagCollection(deserializer.GetValue <IEnumerable <TagBase> >(nameof(Tags)), this);
 }
 private AlwaysCondition(IDeserializer deserializer)
     : base(deserializer)
 {
     Value = deserializer.GetValue <bool>(nameof(Value));
 }
 private RemoveTagsEffect(IDeserializer deserializer)
     : base(deserializer)
 {
     TagKey          = deserializer.GetValue <string>(nameof(TagKey));
     TagKeyMatchKind = deserializer.GetValue <MatchKind>(nameof(TagKeyMatchKind));
 }
 protected ConditionTagBase(IDeserializer deserializer)
     : base(deserializer)
 {
     Condition = deserializer.GetValue <ConditionBase>(nameof(Condition));
 }
 protected ValueCompareCondition(IDeserializer deserializer)
     : base(deserializer)
 {
     CompareIntValue    = deserializer.GetValue <int?>(nameof(CompareIntValue));
     CompareStringValue = deserializer.GetValue <string>(nameof(CompareStringValue));
 }
 protected EffectBase(IDeserializer deserializer)
 {
     Condition = deserializer.GetValue <ConditionBase>(nameof(Condition));
     Target    = deserializer.GetValue <EffectTarget>(nameof(Target));
 }
Example #17
0
 protected TagBase(IDeserializer deserializer)
 {
     Key      = deserializer.GetValue <string>(nameof(Key));
     Duration = deserializer.GetValue <int?>(nameof(Duration));
 }
 private ActionMatrixEntry(IDeserializer deserializer)
 {
     AttackerActionId = deserializer.GetValue <string>(nameof(AttackerActionId));
     DefenderActionId = deserializer.GetValue <string>(nameof(DefenderActionId));
     ResultId         = deserializer.GetValue <string>(nameof(ResultId));
 }
 protected UnaryLogicCondition(IDeserializer deserializer)
     : base(deserializer)
 {
     Child = deserializer.GetValue <ConditionBase>(nameof(Child));
 }