/// <summary> /// Constructor /// </summary> /// <param name="templatePlaceholderResolver">Template placeholder resolver</param> /// <param name="exportCachedDbAccess">Export cached database access</param> /// <param name="exportSnippetFunctionRenderer">Export snippet function renderer</param> /// <param name="defaultTemplateProvider">Default template provider</param> /// <param name="localizerFactory">Localizer Factory</param> public ExportSnippetValueCollector(IExportTemplatePlaceholderResolver templatePlaceholderResolver, IExportCachedDbAccess exportCachedDbAccess, IExportSnippetFunctionRenderer exportSnippetFunctionRenderer, ICachedExportDefaultTemplateProvider defaultTemplateProvider, IStringLocalizerFactory localizerFactory) { _templatePlaceholderResolver = templatePlaceholderResolver; _exportCachedDbAccess = exportCachedDbAccess; _exportSnippetFunctionRenderer = exportSnippetFunctionRenderer; _defaultTemplateProvider = defaultTemplateProvider; _localizerFactory = localizerFactory; }
/// <summary> /// Constructor /// </summary> /// <param name="snippetFunctionRenderer">Snippet function renderer</param> /// <param name="defaultTemplateProvider">Default Template Provider</param> /// <param name="cachedDbAccess">Cached Db Access</param> /// <param name="languageKeyGenerator">Language Key Generator</param> /// <param name="localizerFactory">Localizer Factory</param> public ExportSnippetTemplatePlaceholderResolver(IExportSnippetFunctionRenderer snippetFunctionRenderer, ICachedExportDefaultTemplateProvider defaultTemplateProvider, IExportCachedDbAccess cachedDbAccess, ILanguageKeyGenerator languageKeyGenerator, IStringLocalizerFactory localizerFactory) : base(localizerFactory.Create(typeof(ExportSnippetTemplatePlaceholderResolver))) { _snippetFunctionRenderer = snippetFunctionRenderer; _defaultTemplateProvider = defaultTemplateProvider; _cachedDbAccess = cachedDbAccess; _languageKeyGenerator = languageKeyGenerator; _renderedNodeGraphs = new Dictionary <string, ExportNodeGraphRenderResult>(); }
/// <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="scribanLanguageKeyGenerator">Scriban Language key generator</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="legacyDailyRoutineEventPlaceholderResolver">Legacy Daily routine event placeholder resolver</param> /// <param name="legacyDailyRoutineEventContentPlaceholderResolver">Legacy Daily routine event content placeholder resolver</param> /// <param name="dailyRoutineFunctionNameGenerator">Daily routine function name generator</param> /// <param name="dailyRoutineFunctionRenderer">Daily routine function renderer</param> /// <param name="nodeGraphExporter">Node Graph Exporter</param> /// <param name="exportSnippetFunctionRenderer">Export snippet function renderer</param> /// <param name="stateMachineFunctionNameGenerator">State machine function name generator</param> /// <param name="stateMachineFunctionRenderer">State machine function renderer</param> /// <param name="localizerFactory">Localizer Factory</param> public ExportTemplatePlaceholderResolver(ICachedExportDefaultTemplateProvider defaultTemplateProvider, IExportCachedDbAccess cachedDbAccess, ILanguageKeyGenerator languageKeyGenerator, IScribanLanguageKeyGenerator scribanLanguageKeyGenerator, ILanguageKeyDbAccess languageKeyDbAccess, ITaleDbAccess taleDbAccess, IExportDialogParser dialogParser, IExportDialogFunctionGenerator dialogFunctionGenerator, IExportDialogRenderer dialogRenderer, ILegacyDailyRoutineEventPlaceholderResolver legacyDailyRoutineEventPlaceholderResolver, ILegacyDailyRoutineEventContentPlaceholderResolver legacyDailyRoutineEventContentPlaceholderResolver, IDailyRoutineFunctionNameGenerator dailyRoutineFunctionNameGenerator, IDailyRoutineFunctionRenderer dailyRoutineFunctionRenderer, INodeGraphExporter nodeGraphExporter, IExportSnippetFunctionRenderer exportSnippetFunctionRenderer, IStateMachineFunctionNameGenerator stateMachineFunctionNameGenerator, IStateMachineFunctionRenderer stateMachineFunctionRenderer, IStringLocalizerFactory localizerFactory) { dialogRenderer.SetExportTemplatePlaceholderResolver(this); _renderingEngine = new Dictionary <ExportTemplateRenderingEngine, IExportTemplatePlaceholderRenderingEngine>(); _renderingEngine.Add(ExportTemplateRenderingEngine.Legacy, new LegacyExportTemplatePlaceholderRenderingEngine(this, defaultTemplateProvider, cachedDbAccess, languageKeyGenerator, languageKeyDbAccess, taleDbAccess, dialogParser, dialogFunctionGenerator, dialogRenderer, legacyDailyRoutineEventPlaceholderResolver, legacyDailyRoutineEventContentPlaceholderResolver, dailyRoutineFunctionRenderer, nodeGraphExporter, exportSnippetFunctionRenderer, localizerFactory)); _renderingEngine.Add(ExportTemplateRenderingEngine.Scriban, new ScribanExportTemplatePlaceholderRenderingEngine(this, cachedDbAccess, taleDbAccess, defaultTemplateProvider, scribanLanguageKeyGenerator, dialogParser, dialogFunctionGenerator, dialogRenderer, dailyRoutineFunctionNameGenerator, dailyRoutineFunctionRenderer, exportSnippetFunctionRenderer, stateMachineFunctionNameGenerator, stateMachineFunctionRenderer, languageKeyDbAccess, localizerFactory)); }
/// <summary> /// Constructor /// </summary> /// <param name="exportTemplatePlaceholderResolver">Export template placeholder resolver</param> /// <param name="exportCachedDbAccess">Export cached database access</param> /// <param name="taleDbAccess">Dialog database access</param> /// <param name="defaultTemplateProvider">Default template provider</param> /// <param name="languageKeyGenerator">Language key generator</param> /// <param name="dialogParser">Dialog Parser</param> /// <param name="dialogFunctionGenerator">Dialog Function Generator</param> /// <param name="dialogRenderer">Dialog Renderer</param> /// <param name="dailyRoutineFunctionNameGenerator">Daily routine function name generator</param> /// <param name="dailyRoutineFunctionRenderer">Daily routine function renderer</param> /// <param name="exportSnippetFunctionRenderer">Export snippet function renderer</param> /// <param name="stateMachineFunctionNameGenerator">State machine function name generator</param> /// <param name="stateMachineFunctionRenderer">State machine function renderer</param> /// <param name="languageKeyDbAccess">Language key Database access</param> /// <param name="localizerFactory">Localizer Factory</param> public ScribanExportTemplatePlaceholderRenderingEngine(IExportTemplatePlaceholderResolver exportTemplatePlaceholderResolver, IExportCachedDbAccess exportCachedDbAccess, ITaleDbAccess taleDbAccess, ICachedExportDefaultTemplateProvider defaultTemplateProvider, IScribanLanguageKeyGenerator languageKeyGenerator, IExportDialogParser dialogParser, IExportDialogFunctionGenerator dialogFunctionGenerator, IExportDialogRenderer dialogRenderer, IDailyRoutineFunctionNameGenerator dailyRoutineFunctionNameGenerator, IDailyRoutineFunctionRenderer dailyRoutineFunctionRenderer, IExportSnippetFunctionRenderer exportSnippetFunctionRenderer, IStateMachineFunctionNameGenerator stateMachineFunctionNameGenerator, IStateMachineFunctionRenderer stateMachineFunctionRenderer, ILanguageKeyDbAccess languageKeyDbAccess, IStringLocalizerFactory localizerFactory) { _exportCachedDbAccess = exportCachedDbAccess; _localizerFactory = localizerFactory; _exportValueCollectors = new List <IScribanExportValueCollector> { new NpcExportValueCollector(exportTemplatePlaceholderResolver, exportCachedDbAccess, defaultTemplateProvider, languageKeyGenerator, localizerFactory), new ItemExportValueCollector(exportTemplatePlaceholderResolver, exportCachedDbAccess, defaultTemplateProvider, languageKeyGenerator, localizerFactory), new SkillExportValueCollector(exportTemplatePlaceholderResolver, exportCachedDbAccess, defaultTemplateProvider, languageKeyGenerator, localizerFactory), new AttributeListValueCollector(exportCachedDbAccess, languageKeyGenerator, localizerFactory), new InventoryValueCollector(exportCachedDbAccess, languageKeyGenerator, localizerFactory), new NpcSkillValueCollector(exportCachedDbAccess, languageKeyGenerator, localizerFactory), new DialogValueCollector(exportTemplatePlaceholderResolver, exportCachedDbAccess, defaultTemplateProvider, taleDbAccess, languageKeyGenerator, dialogParser, dialogFunctionGenerator, dialogRenderer, localizerFactory), new DialogFunctionValueCollector(localizerFactory), new NpcDailyRoutineExportValueCollector(exportTemplatePlaceholderResolver, exportCachedDbAccess, dailyRoutineFunctionNameGenerator, dailyRoutineFunctionRenderer, defaultTemplateProvider, localizerFactory), new NpcStateMachineExportValueCollector(exportTemplatePlaceholderResolver, exportCachedDbAccess, stateMachineFunctionNameGenerator, stateMachineFunctionRenderer, defaultTemplateProvider, localizerFactory), new StateMachineFunctionValueCollector(localizerFactory), new DailyRoutineEventListValueCollector(exportCachedDbAccess, dailyRoutineFunctionNameGenerator, localizerFactory), new DailyRoutineFunctionValueCollector(localizerFactory), new DailyRoutineFunctionListValueCollector(exportTemplatePlaceholderResolver, exportCachedDbAccess, defaultTemplateProvider, localizerFactory), new ExportSnippetValueCollector(exportTemplatePlaceholderResolver, exportCachedDbAccess, exportSnippetFunctionRenderer, defaultTemplateProvider, localizerFactory), new ExportSnippetFunctionValueCollector(localizerFactory), new LanguageKeyValueCollector(exportCachedDbAccess, languageKeyDbAccess, localizerFactory) }; }
/// <summary> /// Constructor /// </summary> /// <param name="placeholderResolver">Placeholder Resolver</param> /// <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="legacyDailyRoutineEventPlaceholderResolver">Legacy daily routine event placeholder resolver</param> /// <param name="legacyDailyRoutineEventContentPlaceholderResolver">Legacy Daily routine event content placeholder resolver</param> /// <param name="dailyRoutineFunctionRenderer">Daily routine function renderer</param> /// <param name="nodeGraphExporter">Node Graph Exporter</param> /// <param name="snippetFunctionRenderer">Export Snippet Function renderer</param> /// <param name="localizerFactory">Localizer Factory</param> public LegacyExportTemplatePlaceholderRenderingEngine(IExportTemplatePlaceholderResolver placeholderResolver, ICachedExportDefaultTemplateProvider defaultTemplateProvider, IExportCachedDbAccess cachedDbAccess, ILanguageKeyGenerator languageKeyGenerator, ILanguageKeyDbAccess languageKeyDbAccess, ITaleDbAccess taleDbAccess, IExportDialogParser dialogParser, IExportDialogFunctionGenerator dialogFunctionGenerator, IExportDialogRenderer dialogRenderer, ILegacyDailyRoutineEventPlaceholderResolver legacyDailyRoutineEventPlaceholderResolver, ILegacyDailyRoutineEventContentPlaceholderResolver legacyDailyRoutineEventContentPlaceholderResolver, IDailyRoutineFunctionRenderer dailyRoutineFunctionRenderer, INodeGraphExporter nodeGraphExporter, IExportSnippetFunctionRenderer snippetFunctionRenderer, IStringLocalizerFactory localizerFactory) { _localizerFactory = localizerFactory; dialogRenderer.SetExportTemplatePlaceholderResolver(placeholderResolver); _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 ExportSnippetTemplatePlaceholderResolver(snippetFunctionRenderer, defaultTemplateProvider, cachedDbAccess, languageKeyGenerator, localizerFactory)); _exportTemplatePlaceholderResolvers.Add(new NpcInventoryExportTemplatePlaceholderResolver(defaultTemplateProvider, cachedDbAccess, languageKeyGenerator, localizerFactory)); _exportTemplatePlaceholderResolvers.Add(new NpcSkillExportTemplatePlaceholderResolver(defaultTemplateProvider, cachedDbAccess, languageKeyGenerator, localizerFactory)); _exportTemplatePlaceholderResolvers.Add(new NpcDailyRoutineExportPlaceholderResolver(defaultTemplateProvider, cachedDbAccess, legacyDailyRoutineEventPlaceholderResolver, legacyDailyRoutineEventContentPlaceholderResolver, dailyRoutineFunctionRenderer, languageKeyGenerator, localizerFactory)); _exportTemplatePlaceholderResolvers.Add(new FlexFieldExportTemplatePlaceholderResolver(defaultTemplateProvider, cachedDbAccess, languageKeyGenerator, localizerFactory)); _exportTemplatePlaceholderResolvers.Add(new DialogExportTemplatePlaceholderResolver(cachedDbAccess, languageKeyGenerator, taleDbAccess, dialogParser, dialogFunctionGenerator, dialogRenderer, defaultTemplateProvider, localizerFactory)); _exportTemplatePlaceholderResolvers.Add(new LanguageKeyTemplatePlaceholderResolver(defaultTemplateProvider, cachedDbAccess, languageKeyDbAccess, localizerFactory)); foreach (IExportTemplateTopicPlaceholderResolver curResolver in _exportTemplatePlaceholderResolvers) { curResolver.SetExportTemplatePlaceholderResolver(placeholderResolver); } }