}
override func execute() {
// 左のタブがAllじゃない時は無視する
- guard let tab = arguments["api_tab_id"].flatMap({ Int($0) }),
+ guard let tab = parameter["api_tab_id"].int,
tab == 0
else { return }
let quests = store.sortedQuestByNo()
data["api_list"].forEach { (_, quest) in
guard let no = quest["api_no"].int
- else { return }
+ else { return }
let t = quests.binarySearch { $0.no ==? no }
guard let new = t ?? store.createQuest()
else { return print("Can not create Quest") }
- new.bonus_flag = quest["api_bonus_flag"].bool ?? false
+ new.bonus_flag = quest["api_bonus_flag"].int.map { $0 != 0} ?? false
new.category = quest["api_category"].int ?? 0
new.detail = quest["api_detail"].string ?? ""
// new.get_material_0 = questData["api_get_material_0"] as? Int ?? 0