partial void UpdateCore(RawQuest raw, DateTimeOffset timeStamp) { var lastTime = owner.StatePersist.GetQuestTime(Id); owner.StatePersist.SetQuestActive(Id, State == QuestState.Active, timeStamp); Targets?.Check(timeStamp, lastTime, Period); }
internal void InsertRecord(RawQuest rpQuest, int rpProgress) { using (var rCommand = Connection.CreateCommand()) { rCommand.CommandText = "INSERT OR REPLACE INTO quest(id, name, description, type, state, progress, update_time) " + "VALUES(@id, @name, @description, @type, @state, @progress, strftime('%s', 'now'));"; rCommand.Parameters.AddWithValue("@id", rpQuest.ID); rCommand.Parameters.AddWithValue("@name", rpQuest.Name); rCommand.Parameters.AddWithValue("@description", rpQuest.Description); rCommand.Parameters.AddWithValue("@type", rpQuest.Type); rCommand.Parameters.AddWithValue("@state", (int)rpQuest.State); rCommand.Parameters.AddWithValue("@progress", rpProgress); rCommand.ExecuteNonQuery(); } }