コード例 #1
0
ファイル: Main.cs プロジェクト: zifro-playground/ui
        private void SetLevelSettings()
        {
            if (currentLevelSettings == null)
            {
                return;
            }

            if (!string.IsNullOrEmpty(currentLevelSettings.precode))
            {
                PMWrapper.preCode = currentLevelSettings.precode;
            }

            if (currentLevelSettings.taskDescription != null && !ignorePlayingGuides)
            {
                PMWrapper.SetTaskDescription(currentLevelSettings.taskDescription.header,
                                             currentLevelSettings.taskDescription.body);
            }
            else
            {
                PMWrapper.SetTaskDescription("", "");
            }

            if (currentLevelSettings.rowLimit > 0)
            {
                PMWrapper.codeRowsLimit = currentLevelSettings.rowLimit;
            }

            if (currentLevelSettings.availableFunctions != null)
            {
                List <IEmbeddedType> availableFunctions =
                    CreateFunctionsFromStrings(currentLevelSettings.availableFunctions);
                PMWrapper.AddCompilerFunctions(availableFunctions);
            }
        }
コード例 #2
0
ファイル: Main.cs プロジェクト: zifro-playground/kjell-games
        private void SetLevelSettings()
        {
            UISingleton.instance.saveData.ClearPreAndMainCode();

            if (currentLevelSettings == null)
            {
                return;
            }

            if (!String.IsNullOrEmpty(currentLevelSettings.precode))
            {
                PMWrapper.preCode = currentLevelSettings.precode;
            }

            if (!String.IsNullOrEmpty(currentLevelSettings.startCode))
            {
                PMWrapper.AddCodeAtStart(currentLevelSettings.startCode);
            }

            if (currentLevelSettings.taskDescription != null)
            {
                PMWrapper.SetTaskDescription(currentLevelSettings.taskDescription.header, currentLevelSettings.taskDescription.body);
            }
            else
            {
                PMWrapper.SetTaskDescription("", "");
            }

            if (currentLevelSettings.rowLimit > 0)
            {
                PMWrapper.codeRowsLimit = currentLevelSettings.rowLimit;
            }

            if (currentLevelSettings.availableFunctions != null)
            {
                var availableFunctions = CreateFunctionsFromStrings(currentLevelSettings.availableFunctions);
                PMWrapper.AddCompilerFunctions(availableFunctions);
            }
        }