// // GET: /Chapter/Edit/5 public ActionResult Edit(Guid id) { Chapter chapter = ChapterManager.Get(id); ViewBag.BookId = new SelectList(BookManager.GetAll(), "Id", "Title", chapter.BookId); return(View(chapter)); }
// Start is called before the first frame update protected override void Init() { Application.targetFrameRate = 60; inputManager = new InputManager(); battleManager = new BattleManager(); uiManager = new UIManager(); gridTileManager = new GridTileManager(); chapterManager = new ChapterManager(); BindKeyInput(); uiManager.InitBattleUI(GameObject.Find("Panel(0/9)").transform, GameObject.Find("Panel(9/16)").transform, GameObject.Find("Panel(0/16)").transform); battleManager.ShowMoveRangeAction = ShowMoveRange; battleManager.ShowSelectTargetRangeAction = ShowSelectTargetRange; battleManager.ShowEffectTargetRangeAction = ShowEffectTargetRange; battleManager.ShowHighlightRangeAction = pathShower.ShowHighLightTiles; battleManager.ShowTalkCharacterRangeAction = pathShower.ShowTalkCharacterTiles; battleManager.ClearHighlightRangeAction = () => pathShower.HidePath(PathShower.EPathShowerType.HighLight); battleManager.IsRangeVisible = pathShower.IsRangeVisible; battleManager.ClearRangeAction = pathShower.HideAll; battleManager.UpdateSelectTileInfo = uiManager.UpdateTileInfo; battleManager.UpdateSelectCharacterInfo = uiManager.UpdateCharacterInfo; battleManager.Init(); battlePlayer = new BattlePlayer(); gridTileManager.InitMouseInputEvent(); chapterManager.OnShowTurnIndicate += uiManager.TurnIndicate.Show; LogInitInfo(); TestFunctionAddHere(); }
void Update() { if (AVInputHandler.PointerDown() && AVInputHandler.PointerPosition().y > 600 && AVInputHandler.PointerPosition().y < 1600) { ChapterManager.Progress(); } }
// // GET: /Verse/Edit/5 public ActionResult Edit(Guid id) { Verse verse = VerseManager.Get(id); ViewBag.ChapterId = new SelectList(ChapterManager.GetAll(), "Id", "Title", verse.ChapterId); return(View(verse)); }
public static void HandleCrash(ChapterManager chapterManager, Exception e) { if (!_emergencyHandled) { try { Logger.CrashLog(e); if (chapterManager.IsChapterLoaded) { string dest = ""; if (chapterManager.SaveFileExists) { dest = @"\recovery\" + "RECOVERY" + DateTime.Now.ToString("yyyy_MM_dd_HH_mm_ss") + ".scan"; } else { dest = chapterManager.CurrentSaveFile.Insert(chapterManager.CurrentSaveFile.LastIndexOf("."), "_RECOVERY" + DateTime.Now.ToString("yyyy_MM_dd_HH_mm_ss")); } chapterManager.SaveChapter(dest); using (StreamWriter writer = new StreamWriter(EMERGENCY_FILE, false, Encoding.UTF8)) { writer.WriteLine(dest); writer.Close(); } } _emergencyHandled = true; } catch (Exception) { } } }
public void onClickPause(int type) { if (type == 0) { AudioManager.instance.Pause(12); isGameStart = false; Time.timeScale = 0; pausePanel.gameObject.SetActive(true); pausePanel.transform.SetSiblingIndex(1000); } else if (type == 1) { isGameStart = true; Time.timeScale = 1; pausePanel.gameObject.SetActive(false); AudioManager.instance.UnPause(12); //onClickStart (); } else if (type == 2) //胜利后继续下一关 //Time.timeScale = 1; { ChapterManager.getInstance().GotoNextChapterScene(); } else if (type == 3 || type == 4) { PoolManager.getInstance().clearPool(); SceneManager.LoadScene("GameScene"); } else if (type == 5) //重来 { ChapterManager.getInstance().GotoChapterScene(ChapterManager.getInstance().campaignId); } }
public MiharuMainWindow(ChapterManager chapterManager, string startChapter = null) { InitializeComponent(); _chapterManager = chapterManager; _chapterManager.ChapterChanged += OnChapterChanged; _chapterManager.SaveChanged += OnSaveChanged; _startChapter = startChapter; }
private void Awake() { if (instance != null) { return; } instance = this; }
public ChapterArchiver(IWebHostEnvironment environment, BaseContext context, IHttpClientFactory httpClientFactory, ChapterManager <Chapter> chapterManager, PagesManager <Page> pageManager) { _environment = environment; _context = context; _httpClientFactory = httpClientFactory; _chapterManager = chapterManager; _pageManager = pageManager; }
private void Awake() { chapterManager = ChapterManager.Instance; magia = Magia.Instance; panelCounter = PanelCounter.Instance; touchGestureDetector = TouchGestureDetector.Instance; progress = Progress.Instance; }
public void Trigger() { if (ItemToGiveOrRemove != null && AmountToGiveOrRemove != 0) { ChapterManager.AddOrRemoveItem(ItemToGiveOrRemove, AmountToGiveOrRemove); } ItemOrNpc.CurrentInteractionIndex = NewInteractionIndex; }
public static ChapterManager getInstance() //获取单例 { if (_instance == null) { _instance = new ChapterManager(); } return(_instance); }
// Start is called before the first frame update void Awake() { if (instance != null) { Destroy(instance.gameObject); } instance = this; CameraMovement.FinishedMoving += ActivateNextPanel; }
void Start() { chapterManager = GameObject.Find("ChapterManager").GetComponent <ChapterManager>(); if (newPlayerSpawns == null) { Debug.Log(name + " : Aucun spawnPoint assigné à ce trigger. Le spawn des joueurs n'a pas changé"); } }
protected void createQuestion(object sender, EventArgs e) { ILog logger = LogManager.GetLogger(typeof(Question)); using (FileStream stream = File.OpenRead("d://000/hhyq.docx")) { XWPFDocument docx = new XWPFDocument(stream); string[] strs = new string[7]; Regex regA = new Regex("^[ABCDabcd]{1}.|、", RegexOptions.IgnoreCase); //以A|B|C|D开头 选项 Regex regNO = new Regex("^[0-9]+.|、", RegexOptions.IgnoreCase); //以数字开头 题干 Regex regChapter = new Regex("^第[一二三四五六七八九十]{1,3}章", RegexOptions.IgnoreCase); //章节标题 Regex regnode = new Regex("^第[一二三四五六七八九十]{1,3}节", RegexOptions.IgnoreCase); Chapter chapter = null, node = null; ChapterManager chaptermanager = new ChapterManager(); Question question = null; QuestionManager questonmanager = new QuestionManager(); foreach (var para in docx.Paragraphs) { string text = para.ParagraphText.Trim(); if (!string.IsNullOrWhiteSpace(text) && !string.IsNullOrEmpty(text))//非空 { if (regChapter.IsMatch(text)) { chapter = new Chapter(); chapter.TextBookId = 1; chapter.IsVerified = true; chapter.ChapterDeep = 0; chapter.ChapterName = regChapter.Replace(text, "").Trim(); chapter.ChapterParentNo = 0; chapter.ChapterRemark = chapter.ChapterName; chaptermanager = new ChapterManager(); chapter.ChapterId = chaptermanager.Add(chapter); } else if (regnode.IsMatch(text)) { node = new Chapter(); node.ChapterName = regnode.Replace(text, "").Trim(); node.ChapterParentNo = chapter.ChapterId; node.ChapterDeep = 1; node.ChapterRemark = node.ChapterName; node.TextBookId = 1; node.IsVerified = true; node.ChapterId = chaptermanager.Add(node); } else { string[] paratext = text.Split(new string[] { "A.", "B.", "C.", "D." }, StringSplitOptions.RemoveEmptyEntries); question = StringsTOQuestion(paratext, "D"); question.QuestionId = questonmanager.Add(question); Console.WriteLine(question.QuestionId + " 添加成功。"); } } System.Threading.Thread.Sleep(300); } } }
public ActionResult Details(int chapterId) { var chapter = new ChapterManager().GetChapter(chapterId); if (chapter == null) { return(Content("章节错误,请返回章节目录!")); } return(View(chapter)); }
public ContentController(SignInManager <IdentityUser <Guid> > signInManager, TitlesManager <Title> titlesManager, ChapterManager <Chapter> chapterManager, PagesManager <Page> pagesManager, ChapterArchiver chapterArchiver, ParametersManager parametersManager, IMemoryCache memoryCache) { _signInManager = signInManager; _titlesManager = titlesManager; _chapterManager = chapterManager; _pagesManager = pagesManager; _chapterArchiver = chapterArchiver; _parametersManager = parametersManager; _memoryCache = memoryCache; }
public ActionResult Edit(Chapter chapter) { if (ModelState.IsValid) { ChapterManager.Edit(chapter); return(RedirectToAction("Index")); } return(View()); }
/// <summary> /// Finds the parts. /// </summary> protected override void FindParts() { // TODO: Remove after next release if (!IsFirstRun && !ServerConfigurationManager.Configuration.IsPortAuthorized) { ServerConfigurationManager.Configuration.IsPortAuthorized = true; ConfigurationManager.SaveConfiguration(); } if (!ServerConfigurationManager.Configuration.IsPortAuthorized) { RegisterServerWithAdministratorAccess(); } base.FindParts(); HttpServer.Init(GetExports <IRestfulService>(false)); ServerManager.AddWebSocketListeners(GetExports <IWebSocketListener>(false)); StartServer(); LibraryManager.AddParts(GetExports <IResolverIgnoreRule>(), GetExports <IVirtualFolderCreator>(), GetExports <IItemResolver>(), GetExports <IIntroProvider>(), GetExports <IBaseItemComparer>(), GetExports <ILibraryPostScanTask>()); ProviderManager.AddParts(GetExports <IImageProvider>(), GetExports <IMetadataService>(), GetExports <IItemIdentityProvider>(), GetExports <IItemIdentityConverter>(), GetExports <IMetadataProvider>(), GetExports <IMetadataSaver>(), GetExports <IImageSaver>(), GetExports <IExternalId>()); SeriesOrderManager.AddParts(GetExports <ISeriesOrderProvider>()); ImageProcessor.AddParts(GetExports <IImageEnhancer>()); LiveTvManager.AddParts(GetExports <ILiveTvService>()); SubtitleManager.AddParts(GetExports <ISubtitleProvider>()); ChapterManager.AddParts(GetExports <IChapterProvider>()); SessionManager.AddParts(GetExports <ISessionControllerFactory>()); ChannelManager.AddParts(GetExports <IChannel>(), GetExports <IChannelFactory>()); NotificationManager.AddParts(GetExports <INotificationService>(), GetExports <INotificationTypeFactory>()); SyncManager.AddParts(GetExports <ISyncProvider>()); }
public EditChapterWindow(ChapterManager chapterManager) { InitializeComponent(); _chapterManager = chapterManager; PagesListBox.ItemsSource = _chapterManager.LoadedChapter.Pages; PagesListBox.Items.Refresh(); PagesListBox.SelectedIndex = chapterManager.PageManager.CurrentPageIndex; UpdateButtons(); }
public ActionResult GetChapter(int chapterId) { var novel = new ChapterManager().GetChapter(chapterId); if (novel == null) { return(Json(new { success = true }, JsonRequestBehavior.AllowGet)); } return(Json(new { success = true, data = novel }, JsonRequestBehavior.AllowGet)); }
private void Start() { chaterManager = this.GetComponent <ChapterManager>(); if (m_istomain == 1) { PlayerPrefs.SetInt(Prefstype.IsToMain, 0); TitleWindow.SetActive(false); repeatLight.gameObject.SetActive(true); ChapterWindow.SetActive(true); BackGround.SetActive(true); this.gameObject.GetComponent <TitleManager>().enabled = false; } }
private void Awake() { if (Instance == null) { Instance = this; } else if (Instance != this) { Destroy(gameObject); } player = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerCore>(); }
public static void Main(string[] args) { Application app = new Application(Eto.Platforms.Wpf); ChapterManager chapterManager = null; string startChapter = null; KanjiInputManager kanjiInputManager = null; TranslatorThread translatorThread = null; MiharuMainWindow mainWindow = null; try { Directory.SetCurrentDirectory(AppDomain.CurrentDomain.BaseDirectory.ToString()); if (Init.CheckForTesseract()) { if (Init.CheckForGecko()) { translatorThread = TranslatorThread.StartThread(); } startChapter = Init.CheckCrash(); if (startChapter == null && args.Length > 0 && File.Exists(args [0])) { startChapter = args[0]; } kanjiInputManager = new KanjiInputManager(); chapterManager = new ChapterManager(kanjiInputManager, translatorThread); mainWindow = new MiharuMainWindow(chapterManager, startChapter); app.Run(mainWindow); } } catch (Exception e) { CrashHandler.HandleCrash(chapterManager, e); FileInfo crashFileInfo = new FileInfo(Logger.CurrentCrashLog); MessageBox.Show("There was a fatal error. Details can be found in the generated crash log:" + Environment.NewLine + crashFileInfo.FullName, "Fatal Error", MessageBoxButtons.OK, MessageBoxType.Error, MessageBoxDefaultButton.OK); } finally { mainWindow?.Close(); translatorThread?.FinalizeThread(); } }
public void C1_Ending1_TestSimplePasses() { // Use the Assert class to test conditions ChapterManager.SetChapter("Chapter 1"); // kill the king ChapterManager.InteractWith("King", "Sword"); // add any number of other interactions that are planned here: // check for results of all of these interactions: // get the queen var queen = ChapterManager.CurrentChapter.GetElementByName("Queen"); // check that her current interaction index changed from 0 to 1 Assert.AreEqual(queen.CurrentInteractionIndex, 1); }
public void showWinPanel() { AudioManager.instance.Stop(12); AudioManager.instance.Play(10); Time.timeScale = 0; winPanel.transform.localPosition = new Vector3(0, 0, 0); winPanel.transform.SetSiblingIndex(1100); winPanel.gameObject.SetActive(true); int loveNum = ChapterManager.getInstance().getStar(); for (int i = 0; i < loveNum; i++) { RawImage star = (RawImage)starArr [i]; Destroy(star); } ArrayList arr = TowerManager.getInstance().getTowersList(); for (int i = 0; i < arr.Count; i++) { Tower tower = (Tower)arr [i]; if (tower.isInit) { tower.heroStyle.AnimationState.SetAnimation(0, "celebrate", true).timeScale = 1; tower.isInit = false; } //iTween.MoveBy(tower.body.gameObject, iTween.Hash("y", 15, "easeType", iTween.EaseType.linear, "loopType", "pingPong", "delay", .1)); } for (int i = 0; i < rewardArr.Count; i++) { Text txt = (Text)rewardArr[i]; txt.text = ""; } isGameStart = false; //iTween.Stop (); JsonObject userMessage = new JsonObject(); userMessage.Add("campaignId", ChapterManager.getInstance().campaignId); userMessage.Add("chapterStar", ChapterManager.getInstance().getStar()); userMessage.Add("chapterType", ChapterManager.getInstance().chapterType); //if (LoginScene.pclient != null) { ServerManager.getInstance().request("area.playerHandler.upgradeChapter", userMessage, (databack) => { Debug.Log(databack.ToString()); DataManager.playerData ["chapter"] = databack["chapter"]; dropitems = databack["dropItems"] as List <object>; }); //} }
public ExportDialogue(ChapterManager chapterManager) { InitializeComponent(); _chapterManager = chapterManager; int lastSlashIndex = -1;; if (_chapterManager.CurrentSaveFile == null || ((lastSlashIndex = _chapterManager.CurrentSaveFile.LastIndexOf("\\")) == -1)) { ExportPathTextBox.Text = null; } else { ExportPathTextBox.Text = _chapterManager.CurrentSaveFile.Substring(0, lastSlashIndex) + "\\script.txt"; } IndexPagesLabel.Content = IndexPagesSwitch.OffContent; }
public void init(string[] monsterInfo, int _siblingIndex) { _monsterData = DataManager.getInstance().monsterDicJson[int.Parse(monsterInfo[1])]; // 加载此文件下的所有资源 sprites = Resources.LoadAll <Sprite>(DataManager.getInstance().getJsonStringValue(_monsterData, "style")); if (sprites.Length > 0) { } //Object spri = Resources.Load (_monsterData.monsterStyle); body = this.GetComponent <UnityEngine.UI.Image> (); body.sprite = sprites[spriteIndex]; body.SetNativeSize(); int monsterBaseHp = DataManager.getInstance().getJsonIntValue(_monsterData, "hp"); if (ChapterManager.getInstance().chapterType == 0) { currentHP = beforChangeHP = maxHP = monsterBaseHp + ChapterManager.getInstance().chapterHpAdd1; } else { currentHP = beforChangeHP = maxHP = monsterBaseHp + ChapterManager.getInstance().chapterHpAdd2; } pathArr = DataManager.getInstance().initChapterWaveData(monsterInfo[3]); speed = DataManager.getInstance().getJsonIntValue(_monsterData, "speed"); /**waveArr = DataManager.getInstance ().getData (monsterInfo[3], "\r\n"); * * * if (waveArr.Length > 0) { * oldtWave.x = int.Parse(waveArr[waveIndex][0]); * oldtWave.y = int.Parse(waveArr[waveIndex][1]); * transform.localPosition = oldtWave; * }**/ pathNum = pathArr.Count; if (pathNum > 0) { transform.localPosition = (Vector3)pathArr [waveIndex]; waveIndex++; } //transform.SetSiblingIndex(-10); isDead = false; }
public void HandleEndOfInteraction(InteractiveElementAsset elementAsset) { element = elementAsset; if (elementAsset.CurrentInteraction.Consequences.Count == 0) { FinalizeChoiceActions(); return; } if (elementAsset.CurrentInteraction.Consequences.Count == 1) { FinalizeChoiceActions(); ChapterManager.InteractWith(elementAsset.name, elementAsset.CurrentInteraction.Consequences[0].Choice.name); return; } DisplayInteractions(elementAsset); }
/// <summary> /// Finds the parts. /// </summary> protected override void FindParts() { if (IsFirstRun) { RegisterServerWithAdministratorAccess(); } base.FindParts(); HttpServer.Init(GetExports <IRestfulService>(false)); ServerManager.AddWebSocketListeners(GetExports <IWebSocketListener>(false)); StartServer(true); LibraryManager.AddParts(GetExports <IResolverIgnoreRule>(), GetExports <IVirtualFolderCreator>(), GetExports <IItemResolver>(), GetExports <IIntroProvider>(), GetExports <IBaseItemComparer>(), GetExports <ILibraryPostScanTask>()); ProviderManager.AddParts(GetExports <IImageProvider>(), GetExports <IMetadataService>(), GetExports <IMetadataProvider>(), GetExports <IMetadataSaver>(), GetExports <IImageSaver>(), GetExports <IExternalId>()); SeriesOrderManager.AddParts(GetExports <ISeriesOrderProvider>()); ImageProcessor.AddParts(GetExports <IImageEnhancer>()); LiveTvManager.AddParts(GetExports <ILiveTvService>()); SubtitleManager.AddParts(GetExports <ISubtitleProvider>()); ChapterManager.AddParts(GetExports <IChapterProvider>()); SessionManager.AddParts(GetExports <ISessionControllerFactory>()); ChannelManager.AddParts(GetExports <IChannel>(), GetExports <IChannelFactory>()); NotificationManager.AddParts(GetExports <INotificationService>(), GetExports <INotificationTypeFactory>()); }