public void StartQuest(string questName) { var quest = Quests.FirstOrDefault(q => q.Name == questName); if (quest != null) { quest.Start(false); } else { RPGLog.LogError("Failed to start quest. Quest not found: " + questName); } }
private void OnTick(object sender, EventArgs e) { //var s = new Stopwatch(); //s.Start(); if (CannotUpdate()) { return; } try { if (_emptyUpdate) { _emptyUpdate = false; return; } if (_firstUpdate) { Start(); _firstUpdate = false; } Update(); } catch (Exception ex) { if (!(ex is ThreadAbortException)) { RPGLog.LogError(ex.GetType() + ": " + ex.Message + "\n" + ex.StackTrace); RPGLog.Log("Terminated script: " + GetType()); _running = false; } } //if (s.ElapsedMilliseconds > 0) // RPGLog.Log(GetType() + " took " + s.ElapsedMilliseconds + " to tick."); }