public void UseSettings() { PMWrapper.codeRowsLimit = rowLimit; PMWrapper.SetTaskDescription(taskDescription); PMWrapper.preCode = preCode; PMWrapper.AddCodeAtStart(startCode); UISingleton.instance.levelHandler.currentLevel.caseHandler = new CaseHandler(caseCount); PMWrapper.codewalkerBaseSpeed = gameSpeed; PMWrapper.SetSmartButtons(smartButtons); PMWrapper.SetCompilerFunctions(functions); }
private void LoadMainCode() { if (Progress.instance.levelData[PMWrapper.currentLevel.id].isStarted) { PMWrapper.mainCode = Progress.instance.levelData[PMWrapper.currentLevel.id].mainCode; } else { if (currentLevelSettings?.startCode != null) { PMWrapper.AddCodeAtStart(currentLevelSettings.startCode); } else { PMWrapper.mainCode = string.Empty; } Progress.instance.levelData[PMWrapper.currentLevel.id].isStarted = true; } }
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); } }