Пример #1
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="defaultTemplateProvider">Default Template Provider</param>
 /// <param name="cachedDbAccess">Cached Db Access</param>
 /// <param name="dailyRoutineEventPlaceholderResolver">Daily Rotuine event placeholder resolver</param>
 /// <param name="languageKeyGenerator">Language Key Generator</param>
 /// <param name="localizerFactory">Localizer Factory</param>
 /// <param name="isDisable">true if the event is for a disable action</param>
 public SetDailyRoutineEventState(ICachedExportDefaultTemplateProvider defaultTemplateProvider, IExportCachedDbAccess cachedDbAccess, IDailyRoutineEventPlaceholderResolver dailyRoutineEventPlaceholderResolver, ILanguageKeyGenerator languageKeyGenerator, IStringLocalizerFactory localizerFactory, bool isDisable)
 {
     _defaultTemplateProvider = defaultTemplateProvider;
     _cachedDbAccess          = cachedDbAccess;
     _dailyRoutineEventPlaceholderResolver = dailyRoutineEventPlaceholderResolver;
     _flexFieldPlaceholderResolver         = new FlexFieldExportTemplatePlaceholderResolver(defaultTemplateProvider, cachedDbAccess, languageKeyGenerator, localizerFactory, NpcPlaceholderPrefix);
     _isDisable = isDisable;
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="defaultTemplateProvider">Default Template Provider</param>
 /// <param name="cachedDbAccess">Cached Db Access</param>
 /// <param name="eventPlaceholderResolver">Daily routine event placeholder resolver</param>
 /// <param name="eventContentPlaceholderResolver">Daily routine event content palceholder resolver</param>
 /// <param name="languageKeyGenerator">Language Key Generator</param>
 /// <param name="localizerFactory">Localizer Factory</param>
 public NpcDailyRoutineExportPlaceholderResolver(ICachedExportDefaultTemplateProvider defaultTemplateProvider, IExportCachedDbAccess cachedDbAccess, IDailyRoutineEventPlaceholderResolver eventPlaceholderResolver,
                                                 IDailyRoutineEventContentPlaceholderResolver eventContentPlaceholderResolver, ILanguageKeyGenerator languageKeyGenerator, IStringLocalizerFactory localizerFactory)
     : base(localizerFactory.Create(typeof(NpcDailyRoutineExportPlaceholderResolver)))
 {
     _defaultTemplateProvider         = defaultTemplateProvider;
     _cachedDbAccess                  = cachedDbAccess;
     _eventPlaceholderResolver        = eventPlaceholderResolver;
     _eventContentPlaceholderResolver = eventContentPlaceholderResolver;
     _languageKeyGenerator            = languageKeyGenerator;
 }
Пример #3
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="defaultTemplateProvider">Default Template Provider</param>
 /// <param name="cachedDbAccess">Cached Db Access</param>
 /// <param name="languageKeyGenerator">Language Key Generator</param>
 /// <param name="conditionRenderer">Condition Renderer</param>
 /// <param name="dailyRoutineEventPlaceholderResolver">Daily routine event placeholder resolver</param>
 /// <param name="stringLocalizerFactory">String Localizer Factor</param>
 public NodeGraphBaseRenderer(ICachedExportDefaultTemplateProvider defaultTemplateProvider, IExportCachedDbAccess cachedDbAccess, ILanguageKeyGenerator languageKeyGenerator,
                              IConditionRenderer conditionRenderer, IDailyRoutineEventPlaceholderResolver dailyRoutineEventPlaceholderResolver, IStringLocalizerFactory stringLocalizerFactory)
 {
     _defaultTemplateProvider = defaultTemplateProvider;
     _cachedDbAccess          = cachedDbAccess;
     _languageKeyGenerator    = languageKeyGenerator;
     _conditionRenderer       = conditionRenderer;
     _dailyRoutineEventPlaceholderResolver = dailyRoutineEventPlaceholderResolver;
     _stringLocalizerFactory = stringLocalizerFactory;
     _stepRenderers          = new List <IExportDialogStepRenderer>();
 }
Пример #4
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="defaultTemplateProvider">Default Template Provider</param>
        /// <param name="cachedDbAccess">Cached Db Access</param>
        /// <param name="languageKeyGenerator">Language Key Generator</param>
        /// <param name="languageKeyDbAccess">Language Key Db Access</param>
        /// <param name="taleDbAccess">Dialog Db Access</param>
        /// <param name="dialogParser">Dialog Parser</param>
        /// <param name="dialogFunctionGenerator">Dialog Function Generator</param>
        /// <param name="dialogRenderer">Dialog Renderer</param>
        /// <param name="dailyRoutineEventPlaceholderResolver">Daily routine event placeholder resolver</param>
        /// <param name="dailyRoutineEventContentPlaceholderResolver">Daily routine event content placeholder resolver</param>
        /// <param name="localizerFactory">Localizer Factory</param>
        public ExportTemplatePlaceholderResolver(ICachedExportDefaultTemplateProvider defaultTemplateProvider, IExportCachedDbAccess cachedDbAccess, ILanguageKeyGenerator languageKeyGenerator, ILanguageKeyDbAccess languageKeyDbAccess,
                                                 ITaleDbAccess taleDbAccess, IExportDialogParser dialogParser, IExportDialogFunctionGenerator dialogFunctionGenerator, IExportDialogRenderer dialogRenderer,
                                                 IDailyRoutineEventPlaceholderResolver dailyRoutineEventPlaceholderResolver, IDailyRoutineEventContentPlaceholderResolver dailyRoutineEventContentPlaceholderResolver, IStringLocalizerFactory localizerFactory)
        {
            _localizerFactory = localizerFactory;


            _exportTemplatePlaceholderResolvers = new List <IExportTemplateTopicPlaceholderResolver>();

            // Order of exporting is determined by the order in which these are  added, thats why the order is important
            _exportTemplatePlaceholderResolvers.Add(new NpcInventoryExportTemplatePlaceholderResolver(defaultTemplateProvider, cachedDbAccess, languageKeyGenerator, localizerFactory));
            _exportTemplatePlaceholderResolvers.Add(new NpcSkillExportTemplatePlaceholderResolver(defaultTemplateProvider, cachedDbAccess, languageKeyGenerator, localizerFactory));
            _exportTemplatePlaceholderResolvers.Add(new NpcDailyRoutineExportPlaceholderResolver(defaultTemplateProvider, cachedDbAccess, dailyRoutineEventPlaceholderResolver, dailyRoutineEventContentPlaceholderResolver, languageKeyGenerator, localizerFactory));
            _exportTemplatePlaceholderResolvers.Add(new FlexFieldExportTemplatePlaceholderResolver(defaultTemplateProvider, cachedDbAccess, languageKeyGenerator, localizerFactory));
            _exportTemplatePlaceholderResolvers.Add(new DialogExportTemplatePlaceholderResolver(cachedDbAccess, languageKeyGenerator, taleDbAccess, dialogParser, dialogFunctionGenerator, dialogRenderer, localizerFactory));
            _exportTemplatePlaceholderResolvers.Add(new LanguageKeyTemplatePlaceholderResolver(defaultTemplateProvider, cachedDbAccess, languageKeyDbAccess, localizerFactory));
        }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="defaultTemplateProvider">Default Template Provider</param>
 /// <param name="cachedDbAccess">Cached Db Access</param>
 /// <param name="languageKeyGenerator">Language Key Generator</param>
 /// <param name="conditionRenderer">Condition Renderer</param>
 /// <param name="dailyRoutineEventPlaceholderResolver">Daily routine event placeholder resolver</param>
 /// <param name="stringLocalizerFactory">String Localizer Factor</param>
 public DailyRoutineNodeGraphRenderer(ICachedExportDefaultTemplateProvider defaultTemplateProvider, IExportCachedDbAccess cachedDbAccess, ILanguageKeyGenerator languageKeyGenerator,
                                      IConditionRenderer conditionRenderer, IDailyRoutineEventPlaceholderResolver dailyRoutineEventPlaceholderResolver, IStringLocalizerFactory stringLocalizerFactory)
     : base(defaultTemplateProvider, cachedDbAccess, languageKeyGenerator, conditionRenderer, dailyRoutineEventPlaceholderResolver, stringLocalizerFactory)
 {
 }
Пример #6
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="defaultTemplateProvider">Default Template Provider</param>
 /// <param name="cachedDbAccess">Cached Db Access</param>
 /// <param name="languageKeyGenerator">Language Key Generator</param>
 /// <param name="conditionRenderer">Condition Renderer</param>
 /// <param name="dailyRoutineEventPlaceholderResolver">Daily routine event placeholder resolver</param>
 /// <param name="stringLocalizerFactory">String Localizer Factor</param>
 public ExportDialogRenderer(ICachedExportDefaultTemplateProvider defaultTemplateProvider, IExportCachedDbAccess cachedDbAccess, ILanguageKeyGenerator languageKeyGenerator,
                             IConditionRenderer conditionRenderer, IDailyRoutineEventPlaceholderResolver dailyRoutineEventPlaceholderResolver, IStringLocalizerFactory stringLocalizerFactory)
     : base(defaultTemplateProvider, cachedDbAccess, languageKeyGenerator, conditionRenderer, dailyRoutineEventPlaceholderResolver, stringLocalizerFactory)
 {
     _localizer = stringLocalizerFactory.Create(typeof(ExportDialogRenderer));
 }
Пример #7
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="defaultTemplateProvider">Default Template Provider</param>
        /// <param name="cachedDbAccess">Cached Db Access</param>
        /// <param name="dailyRoutineEventPlaceholderResolver">Daily routine event placeholder resolver</param>
        /// <param name="languageKeyGenerator">Language Key Generator</param>
        /// <param name="localizerFactory">Localizer Factory</param>
        public ConditionRenderer(ICachedExportDefaultTemplateProvider defaultTemplateProvider, IExportCachedDbAccess cachedDbAccess, IDailyRoutineEventPlaceholderResolver dailyRoutineEventPlaceholderResolver, ILanguageKeyGenerator languageKeyGenerator, IStringLocalizerFactory localizerFactory)
        {
            _defaultTemplateProvider = defaultTemplateProvider;

            _elementRenderes = new Dictionary <ConditionType, IConditionElementRenderer>();
            _elementRenderes.Add(ConditionType.Group, new GroupConditionResolver(this, defaultTemplateProvider, localizerFactory));
            _elementRenderes.Add(ConditionType.PlayerValueCondition, new NpcValueConditionResolver(defaultTemplateProvider, cachedDbAccess, languageKeyGenerator, localizerFactory, true));
            _elementRenderes.Add(ConditionType.NpcValueCondition, new NpcValueConditionResolver(defaultTemplateProvider, cachedDbAccess, languageKeyGenerator, localizerFactory, false));
            _elementRenderes.Add(ConditionType.PlayerInventoryCondition, new InventoryConditionResolver(defaultTemplateProvider, cachedDbAccess, languageKeyGenerator, localizerFactory, true));
            _elementRenderes.Add(ConditionType.NpcInventoryCondition, new InventoryConditionResolver(defaultTemplateProvider, cachedDbAccess, languageKeyGenerator, localizerFactory, false));
            _elementRenderes.Add(ConditionType.ChooseQuestValueCondition, new QuestValueConditionResolver(defaultTemplateProvider, cachedDbAccess, languageKeyGenerator, localizerFactory));
            _elementRenderes.Add(ConditionType.QuestStateCondition, new QuestStateConditionResolver(defaultTemplateProvider, cachedDbAccess, languageKeyGenerator, localizerFactory));
            _elementRenderes.Add(ConditionType.NpcAliveStateCondition, new NpcAliveStateConditionResolver(defaultTemplateProvider, cachedDbAccess, languageKeyGenerator, localizerFactory));
            _elementRenderes.Add(ConditionType.CurrentSkillValueCondition, new CurrentSkillValueConditionResolver(defaultTemplateProvider, cachedDbAccess, languageKeyGenerator, localizerFactory));
            _elementRenderes.Add(ConditionType.GameTimeCondition, new GameTimeConditionResolver(defaultTemplateProvider, cachedDbAccess, localizerFactory));
            _elementRenderes.Add(ConditionType.PlayerSkillValueCondition, new SkillValueConditionResolver(defaultTemplateProvider, cachedDbAccess, languageKeyGenerator, localizerFactory, true));
            _elementRenderes.Add(ConditionType.NpcSkillValueCondition, new SkillValueConditionResolver(defaultTemplateProvider, cachedDbAccess, languageKeyGenerator, localizerFactory, false));
            _elementRenderes.Add(ConditionType.PlayerLearnedSkillCondition, new LearnedSkillConditionResolver(defaultTemplateProvider, cachedDbAccess, languageKeyGenerator, localizerFactory, true, true));
            _elementRenderes.Add(ConditionType.PlayerNotLearnedSkillCondition, new LearnedSkillConditionResolver(defaultTemplateProvider, cachedDbAccess, languageKeyGenerator, localizerFactory, true, false));
            _elementRenderes.Add(ConditionType.NpcLearnedSkillCondition, new LearnedSkillConditionResolver(defaultTemplateProvider, cachedDbAccess, languageKeyGenerator, localizerFactory, false, true));
            _elementRenderes.Add(ConditionType.NpcNotLearnedSkillCondition, new LearnedSkillConditionResolver(defaultTemplateProvider, cachedDbAccess, languageKeyGenerator, localizerFactory, false, false));
            _elementRenderes.Add(ConditionType.RandomValueCondition, new RandomValueConditionResolver(defaultTemplateProvider, localizerFactory));
            _elementRenderes.Add(ConditionType.DailyRoutineEventIsDisabledCondition, new DailyRoutineEventStateConditionResolver(defaultTemplateProvider, cachedDbAccess, dailyRoutineEventPlaceholderResolver, languageKeyGenerator, localizerFactory, true));
            _elementRenderes.Add(ConditionType.DailyRoutineEventIsEnabledCondition, new DailyRoutineEventStateConditionResolver(defaultTemplateProvider, cachedDbAccess, dailyRoutineEventPlaceholderResolver, languageKeyGenerator, localizerFactory, false));
            _elementRenderes.Add(ConditionType.CodeCondition, new CodeConditionResolver(defaultTemplateProvider, localizerFactory));
            _elementRenderes.Add(ConditionType.ItemValueCondition, new ItemValueConditionResolver(defaultTemplateProvider, cachedDbAccess, languageKeyGenerator, localizerFactory));
        }
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="errorCollection">Error Collection</param>
        /// <param name="defaultTemplateProvider">Default Template Provider</param>
        /// <param name="cachedDbAccess">Cached Db Access</param>
        /// <param name="dailyRoutineEventPlaceholderResolver">Daily routine event placeholder resolver</param>
        /// <param name="languageKeyGenerator">Language Key Generator</param>
        /// <param name="localizerFactory">Localizer Factory</param>
        /// <param name="exportSettings">Export Settings</param>
        /// <param name="project">Project</param>
        public ExportDialogActionRenderer(ExportPlaceholderErrorCollection errorCollection, ICachedExportDefaultTemplateProvider defaultTemplateProvider, IExportCachedDbAccess cachedDbAccess, IDailyRoutineEventPlaceholderResolver dailyRoutineEventPlaceholderResolver,
                                          ILanguageKeyGenerator languageKeyGenerator, IStringLocalizerFactory localizerFactory, ExportSettings exportSettings, GoNorthProject project) :
            base(errorCollection, localizerFactory)
        {
            _defaultTemplateProvider = defaultTemplateProvider;
            _languageKeyGenerator    = languageKeyGenerator;
            _localizer      = localizerFactory.Create(typeof(ExportDialogActionRenderer));
            _exportSettings = exportSettings;
            _project        = project;

            _actionRenderes = new Dictionary <ActionType, IActionRenderer>();
            _actionRenderes.Add(ActionType.ChangePlayerValue, new NpcValueChangeRenderer(defaultTemplateProvider, cachedDbAccess, languageKeyGenerator, localizerFactory, true));
            _actionRenderes.Add(ActionType.ChangeNpcValue, new NpcValueChangeRenderer(defaultTemplateProvider, cachedDbAccess, languageKeyGenerator, localizerFactory, false));
            _actionRenderes.Add(ActionType.SpawnItemInPlayerInventory, new InventoryActionRenderer(defaultTemplateProvider, cachedDbAccess, languageKeyGenerator, localizerFactory, true, false, false));
            _actionRenderes.Add(ActionType.TransferItemToPlayerInventory, new InventoryActionRenderer(defaultTemplateProvider, cachedDbAccess, languageKeyGenerator, localizerFactory, true, true, false));
            _actionRenderes.Add(ActionType.RemoveItemFromPlayerInventory, new InventoryActionRenderer(defaultTemplateProvider, cachedDbAccess, languageKeyGenerator, localizerFactory, true, false, true));
            _actionRenderes.Add(ActionType.SpawnItemInNpcInventory, new InventoryActionRenderer(defaultTemplateProvider, cachedDbAccess, languageKeyGenerator, localizerFactory, false, false, false));
            _actionRenderes.Add(ActionType.TransferItemToNpcInventory, new InventoryActionRenderer(defaultTemplateProvider, cachedDbAccess, languageKeyGenerator, localizerFactory, false, true, false));
            _actionRenderes.Add(ActionType.RemoveItemFromNpcInventory, new InventoryActionRenderer(defaultTemplateProvider, cachedDbAccess, languageKeyGenerator, localizerFactory, false, false, true));
            _actionRenderes.Add(ActionType.ChangeQuestValue, new QuestValueChangeRenderer(defaultTemplateProvider, cachedDbAccess, languageKeyGenerator, localizerFactory));
            _actionRenderes.Add(ActionType.ChangeQuestState, new SetQuestStateActionRenderer(defaultTemplateProvider, cachedDbAccess, languageKeyGenerator, localizerFactory));
            _actionRenderes.Add(ActionType.AddQuestText, new AddQuestTextRenderer(defaultTemplateProvider, cachedDbAccess, languageKeyGenerator, localizerFactory));
            _actionRenderes.Add(ActionType.Wait, new WaitActionRenderer(defaultTemplateProvider, localizerFactory));
            _actionRenderes.Add(ActionType.ChangePlayerState, new ChangeNpcStateActionRenderer(defaultTemplateProvider, cachedDbAccess, languageKeyGenerator, localizerFactory, true));
            _actionRenderes.Add(ActionType.ChangeNpcState, new ChangeNpcStateActionRenderer(defaultTemplateProvider, cachedDbAccess, languageKeyGenerator, localizerFactory, false));
            _actionRenderes.Add(ActionType.PlayerLearnSkill, new LearnForgetSkillActionRenderer(defaultTemplateProvider, cachedDbAccess, languageKeyGenerator, localizerFactory, true, true));
            _actionRenderes.Add(ActionType.PlayerForgetSkill, new LearnForgetSkillActionRenderer(defaultTemplateProvider, cachedDbAccess, languageKeyGenerator, localizerFactory, true, false));
            _actionRenderes.Add(ActionType.NpcLearnSkill, new LearnForgetSkillActionRenderer(defaultTemplateProvider, cachedDbAccess, languageKeyGenerator, localizerFactory, false, true));
            _actionRenderes.Add(ActionType.NpcForgetSkill, new LearnForgetSkillActionRenderer(defaultTemplateProvider, cachedDbAccess, languageKeyGenerator, localizerFactory, false, false));
            _actionRenderes.Add(ActionType.ChangePlayerSkillValue, new SkillValueChangeRenderer(defaultTemplateProvider, cachedDbAccess, languageKeyGenerator, localizerFactory, true));
            _actionRenderes.Add(ActionType.ChangeNpcSkillValue, new SkillValueChangeRenderer(defaultTemplateProvider, cachedDbAccess, languageKeyGenerator, localizerFactory, false));
            _actionRenderes.Add(ActionType.PersistDialogState, new PersistDialogStateActionRenderer(defaultTemplateProvider));
            _actionRenderes.Add(ActionType.OpenShop, new OpenShopActionRenderer(defaultTemplateProvider));
            _actionRenderes.Add(ActionType.PlayNpcAnimation, new PlayAnimationActionRenderer(defaultTemplateProvider, cachedDbAccess, languageKeyGenerator, localizerFactory, false));
            _actionRenderes.Add(ActionType.PlayPlayerAnimation, new PlayAnimationActionRenderer(defaultTemplateProvider, cachedDbAccess, languageKeyGenerator, localizerFactory, true));
            _actionRenderes.Add(ActionType.CodeAction, new CodeActionRenderer(defaultTemplateProvider, localizerFactory));
            _actionRenderes.Add(ActionType.ShowFloatingTextAboveNpc, new ShowFloatingTextAboveNpcActionRenderer(defaultTemplateProvider, cachedDbAccess, languageKeyGenerator, localizerFactory, false));
            _actionRenderes.Add(ActionType.ShowFloatingTextAbovePlayer, new ShowFloatingTextAboveNpcActionRenderer(defaultTemplateProvider, cachedDbAccess, languageKeyGenerator, localizerFactory, true));
            _actionRenderes.Add(ActionType.ShowFloatingTextAboveChooseNpc, new ShowFloatingTextAboveChooseNpcActionRenderer(defaultTemplateProvider, cachedDbAccess, languageKeyGenerator, localizerFactory));
            _actionRenderes.Add(ActionType.FadeToBlack, new FadeToFromBlackRenderer(defaultTemplateProvider, localizerFactory, true));
            _actionRenderes.Add(ActionType.FadeFromBlack, new FadeToFromBlackRenderer(defaultTemplateProvider, localizerFactory, false));
            _actionRenderes.Add(ActionType.SetGameTime, new SetGameTimeActionRenderer(defaultTemplateProvider, cachedDbAccess, localizerFactory));
            _actionRenderes.Add(ActionType.DisableDailyRoutineEvent, new SetDailyRoutineEventState(defaultTemplateProvider, cachedDbAccess, dailyRoutineEventPlaceholderResolver, languageKeyGenerator, localizerFactory, true));
            _actionRenderes.Add(ActionType.EnableDailyRoutineEvent, new SetDailyRoutineEventState(defaultTemplateProvider, cachedDbAccess, dailyRoutineEventPlaceholderResolver, languageKeyGenerator, localizerFactory, false));
            _actionRenderes.Add(ActionType.TeleportNpc, new MoveNpcActionRenderer(defaultTemplateProvider, cachedDbAccess, languageKeyGenerator, localizerFactory, true, false, false));
            _actionRenderes.Add(ActionType.TeleportPlayer, new MoveNpcActionRenderer(defaultTemplateProvider, cachedDbAccess, languageKeyGenerator, localizerFactory, true, true, false));
            _actionRenderes.Add(ActionType.TeleportChooseNpc, new MoveNpcActionRenderer(defaultTemplateProvider, cachedDbAccess, languageKeyGenerator, localizerFactory, true, false, true));
            _actionRenderes.Add(ActionType.WalkNpcToMarker, new MoveNpcActionRenderer(defaultTemplateProvider, cachedDbAccess, languageKeyGenerator, localizerFactory, false, false, false));
            _actionRenderes.Add(ActionType.WalkChooseNpcToMarker, new MoveNpcActionRenderer(defaultTemplateProvider, cachedDbAccess, languageKeyGenerator, localizerFactory, false, false, true));
            _actionRenderes.Add(ActionType.TeleportNpcToNpc, new MoveNpcToNpcActionRenderer(defaultTemplateProvider, cachedDbAccess, languageKeyGenerator, localizerFactory, true, false));
            _actionRenderes.Add(ActionType.TeleportChooseNpcToNpc, new MoveNpcToNpcActionRenderer(defaultTemplateProvider, cachedDbAccess, languageKeyGenerator, localizerFactory, true, true));
            _actionRenderes.Add(ActionType.WalkNpcToNpc, new MoveNpcToNpcActionRenderer(defaultTemplateProvider, cachedDbAccess, languageKeyGenerator, localizerFactory, false, false));
            _actionRenderes.Add(ActionType.WalkChooseNpcToNpc, new MoveNpcToNpcActionRenderer(defaultTemplateProvider, cachedDbAccess, languageKeyGenerator, localizerFactory, false, true));
        }