Esempio n. 1
0
        /// <summary>
        /// Returns a new function
        /// </summary>
        /// <param name="projectId">Project id</param>
        /// <param name="npcId">Npc Id</param>
        /// <param name="functionObjectId">Function object id</param>
        /// <returns>New Step Function</returns>
        protected async Task <string> GetNewFunctionName(string projectId, string npcId, string functionObjectId)
        {
            ExportFunctionId functionId = await _functionIdDbAccess.GetExportFunctionId(projectId, npcId, functionObjectId);

            if (functionId == null)
            {
                functionId                  = new ExportFunctionId();
                functionId.ProjectId        = projectId;
                functionId.ObjectId         = npcId;
                functionId.FunctionObjectId = functionObjectId;
                functionId.FunctionId       = await _functionIdDbAccess.GetNewExportFuntionIdForObjectAndSubCategory(projectId, npcId, _idCounterSubCategory);

                await _functionIdDbAccess.SaveNewExportFunctionId(functionId);
            }

            return(string.Format(_functionTemplate, functionId.FunctionId));
        }
Esempio n. 2
0
        /// <summary>
        /// Returns a new dialog step function
        /// </summary>
        /// <param name="stepType">Stype type (Text, Choice)</param>
        /// <param name="projectId">Proejct id</param>
        /// <param name="objectId">Object Id</param>
        /// <param name="functionObjectId">Function object id</param>
        /// <returns>New Dialog Step Function</returns>
        public async Task <string> GetNewDialogStepFunction(string stepType, string projectId, string objectId, string functionObjectId)
        {
            ExportFunctionId functionId = await _functionIdDbAccess.GetExportFunctionId(projectId, objectId, functionObjectId);

            if (functionId == null)
            {
                functionId                  = new ExportFunctionId();
                functionId.ProjectId        = projectId;
                functionId.ObjectId         = objectId;
                functionId.FunctionObjectId = functionObjectId;
                functionId.FunctionId       = await _functionIdDbAccess.GetNewExportFuntionIdForObject(projectId, objectId);

                await _functionIdDbAccess.SaveNewExportFunctionId(functionId);
            }

            return(string.Format(FunctionTemplate, functionId.FunctionId, stepType));
        }
        /// <summary>
        /// Returns a new export snippet function
        /// </summary>
        /// <param name="projectId">Project id</param>
        /// <param name="objectId">Object Id</param>
        /// <param name="exportSnippetId">Export snippet id</param>
        /// <returns>New export snippet Step Function</returns>
        public async Task <string> GetNewExportSnippetStepFunction(string projectId, string objectId, string exportSnippetId)
        {
            ExportFunctionId functionId = await _functionIdDbAccess.GetExportFunctionId(projectId, objectId, exportSnippetId);

            if (functionId == null)
            {
                functionId                  = new ExportFunctionId();
                functionId.ProjectId        = projectId;
                functionId.ObjectId         = objectId;
                functionId.FunctionObjectId = exportSnippetId;
                functionId.FunctionId       = await _functionIdDbAccess.GetNewExportFuntionIdForObjectAndSubCategory(projectId, objectId, ExportSnippetIdCounterSubCategory);

                await _functionIdDbAccess.SaveNewExportFunctionId(functionId);
            }

            return(string.Format(FunctionTemplate, functionId.FunctionId));
        }
Esempio n. 4
0
        /// <summary>
        /// Returns a new daily routine function
        /// </summary>
        /// <param name="projectId">Project id</param>
        /// <param name="npcId">Npc Id</param>
        /// <param name="dailyRoutineEventId">Daily routine event id</param>
        /// <returns>New Daily Routine Step Function</returns>
        public async Task <string> GetNewDailyRoutineStepFunction(string projectId, string npcId, string dailyRoutineEventId)
        {
            ExportFunctionId functionId = await _functionIdDbAccess.GetExportFunctionId(projectId, npcId, dailyRoutineEventId);

            if (functionId == null)
            {
                functionId                  = new ExportFunctionId();
                functionId.ProjectId        = projectId;
                functionId.ObjectId         = npcId;
                functionId.FunctionObjectId = dailyRoutineEventId;
                functionId.FunctionId       = await _functionIdDbAccess.GetNewExportFuntionIdForObjectAndSubCategory(projectId, npcId, DailyRoutineIdCounterSubCategory);

                await _functionIdDbAccess.SaveNewExportFunctionId(functionId);
            }

            return(string.Format(FunctionTemplate, functionId.FunctionId));
        }