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)); }
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 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); }
private StringLookup(IDeserializer deserializer) { m_lookup = deserializer.GetValues <List <string> >("Lookup").EmptyIfNull().ToDictionary(x => x[0], x => x[1]); }
protected BinaryLogicCondition(IDeserializer deserializer) : base(deserializer) { Children = deserializer.GetValues <ConditionBase>(nameof(Children)).EmptyIfNull().ToList().AsReadOnly(); }