示例#1
0
 private ActionViewModel(string name, string key, IEnumerable <TagViewModelBase> tags, StringLookupViewModel stringLookup)
 {
     m_name       = name;
     m_key        = key;
     Tags         = new ObservableCollection <TagViewModelBase>(tags);
     StringLookup = stringLookup;
 }
示例#2
0
        private EntityRulesViewModel(string name, IEnumerable <EffectViewModelBase> preBattleEffects, IEnumerable <EffectViewModelBase> postBattleEffects, IEnumerable <EffectViewModelBase> preTurnEffects, IEnumerable <EffectViewModelBase> postTurnEffects, ConditionViewModelBase eliminationCondition, IEnumerable <ActionViewModel> actions, IEnumerable <ResultViewModel> results, ActionMatrixViewModel actionMatrix, StringLookupViewModel stringLookup)
        {
            m_name = name;
            m_eliminationCondition = eliminationCondition;

            m_selectedRule = new TreeNodeViewModel <LabeledViewModelBase>("", Enumerable.Empty <LabeledViewModelBase>());

            m_preBattleEffectsNode  = new TreeNodeViewModel <EffectViewModelBase>(OurResources.PreBattleEffectsNodeLabel, preBattleEffects);
            m_postBattleEffectsNode = new TreeNodeViewModel <EffectViewModelBase>(OurResources.PostBattleEffectsNodeLabel, postBattleEffects);
            m_preTurnEffectsNode    = new TreeNodeViewModel <EffectViewModelBase>(OurResources.PreTurnEffectsNodeLabel, preTurnEffects);
            m_postTurnEffectsNode   = new TreeNodeViewModel <EffectViewModelBase>(OurResources.PostTurnEffectsNodeLabel, postTurnEffects);
            m_actionsNode           = new TreeNodeViewModel <ActionViewModel>(OurResources.ActionsNodeLabel, actions);
            m_resultsNode           = new TreeNodeViewModel <ResultViewModel>(OurResources.ResultsNodeLabel, results);

            Rules = new List <TreeNodeViewModelBase>
            {
                m_preBattleEffectsNode,
                m_preTurnEffectsNode,
                m_postTurnEffectsNode,
                m_postBattleEffectsNode,
                m_actionsNode,
                m_resultsNode,
            };

            ActionMatrix = actionMatrix;
            StringLookup = stringLookup;
        }
        public static ResultViewModel CreateFromData(Result result, StringLookupViewModel stringLookup)
        {
            var effects = result.Effects.Select(EffectViewModelBase.CreateFromData);
            var tags    = result.Tags.Select(TagViewModelBase.CreateFromData);

            return(new ResultViewModel(result.Name, result.Key, effects, tags, stringLookup));
        }
 private ResultViewModel(string name, string key, IEnumerable <EffectViewModelBase> effects, IEnumerable <TagViewModelBase> tags, StringLookupViewModel stringLookup)
 {
     m_name       = name;
     m_key        = key;
     Effects      = new ObservableCollection <EffectViewModelBase>(effects);
     Tags         = new ObservableCollection <TagViewModelBase>(tags);
     StringLookup = stringLookup;
 }
示例#5
0
        public static EntityRulesViewModel CreateFromData(EntityRules entity)
        {
            var stringLookup         = StringLookupViewModel.CreateFromData(entity.StringLookup);
            var preBattleEffects     = entity.PreBattleEffects.Select(EffectViewModelBase.CreateFromData);
            var postBattleEffects    = entity.PostBattleEffects.Select(EffectViewModelBase.CreateFromData);
            var preTurnEffects       = entity.PreTurnEffects.Select(EffectViewModelBase.CreateFromData);
            var postTurnEffects      = entity.PostTurnEffects.Select(EffectViewModelBase.CreateFromData);
            var eliminationCondition = ConditionViewModelBase.CreateFromData(entity.EliminationCondition);
            var actions      = entity.Actions.Select(x => ActionViewModel.CreateFromData(x, stringLookup));
            var results      = entity.Results.Select(x => ResultViewModel.CreateFromData(x, stringLookup));
            var actionMatrix = ActionMatrixViewModel.CreateFromData(entity.ActionMatrix.Values);

            return(new EntityRulesViewModel(entity.Name, preBattleEffects, postBattleEffects, preTurnEffects, postTurnEffects, eliminationCondition, actions, results, actionMatrix, stringLookup));
        }
示例#6
0
        public static ActionViewModel CreateFromData(Action action, StringLookupViewModel stringLookup)
        {
            var tags = action.Tags.Select(TagViewModelBase.CreateFromData);

            return(new ActionViewModel(action.Name, action.Key, tags, stringLookup));
        }