From 6c3ec4d520559cbf56aa547aa8ac24ffd6554345 Mon Sep 17 00:00:00 2001 From: masakih Date: Sat, 28 Nov 2015 20:52:39 +0900 Subject: [PATCH] =?utf8?q?=E9=80=A3=E5=90=88=E8=89=A6=E9=9A=8A=E3=81=AE?= =?utf8?q?=E7=B7=A8=E6=88=90=E3=80=81=E8=A7=A3=E9=99=A4=E6=99=82=E3=81=ABN?= =?utf8?q?otification=E3=82=92=E9=A3=9B=E3=81=AF=E3=82=99=E3=81=99?= =?utf8?q?=E3=82=88=E3=81=86=E3=81=AB=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- KCD.xcodeproj/project.pbxproj | 6 ++++++ KCD/HMCombinedCommand.h | 23 +++++++++++++++++++++++ KCD/HMCombinedCommand.m | 40 ++++++++++++++++++++++++++++++++++++++++ KCD/HMIgnoreCommand.m | 1 - 4 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 KCD/HMCombinedCommand.h create mode 100644 KCD/HMCombinedCommand.m diff --git a/KCD.xcodeproj/project.pbxproj b/KCD.xcodeproj/project.pbxproj index eaec2b26..f094829b 100644 --- a/KCD.xcodeproj/project.pbxproj +++ b/KCD.xcodeproj/project.pbxproj @@ -207,6 +207,7 @@ F4F4791A1BFE223600D0BF69 /* HMCombileViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F4F479181BFE223600D0BF69 /* HMCombileViewController.m */; }; F4F4791B1BFE223600D0BF69 /* HMCombileViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = F4F479191BFE223600D0BF69 /* HMCombileViewController.xib */; }; F4F479201C01424200D0BF69 /* HMVerticalFleetViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = F4F4791E1C01424200D0BF69 /* HMVerticalFleetViewController.xib */; }; + F4F479261C074E9900D0BF69 /* HMCombinedCommand.m in Sources */ = {isa = PBXBuildFile; fileRef = F4F479251C074E9900D0BF69 /* HMCombinedCommand.m */; }; F4F6E8081B2B17E50008B66E /* HMStrengthenListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F4F6E8061B2B17E50008B66E /* HMStrengthenListViewController.m */; }; F4F6E8091B2B17E50008B66E /* HMStrengthenListViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = F4F6E8071B2B17E50008B66E /* HMStrengthenListViewController.xib */; }; F4F6E80C1B2BC81C0008B66E /* HMPeriodicNotifier.m in Sources */ = {isa = PBXBuildFile; fileRef = F4F6E80B1B2BC81C0008B66E /* HMPeriodicNotifier.m */; }; @@ -589,6 +590,8 @@ F4F479181BFE223600D0BF69 /* HMCombileViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HMCombileViewController.m; sourceTree = ""; }; F4F479191BFE223600D0BF69 /* HMCombileViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = HMCombileViewController.xib; sourceTree = ""; }; F4F4791E1C01424200D0BF69 /* HMVerticalFleetViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = HMVerticalFleetViewController.xib; sourceTree = ""; }; + F4F479241C074E9900D0BF69 /* HMCombinedCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HMCombinedCommand.h; sourceTree = ""; }; + F4F479251C074E9900D0BF69 /* HMCombinedCommand.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HMCombinedCommand.m; sourceTree = ""; }; F4F6E8051B2B17E50008B66E /* HMStrengthenListViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HMStrengthenListViewController.h; sourceTree = ""; }; F4F6E8061B2B17E50008B66E /* HMStrengthenListViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HMStrengthenListViewController.m; sourceTree = ""; }; F4F6E8071B2B17E50008B66E /* HMStrengthenListViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = HMStrengthenListViewController.xib; sourceTree = ""; }; @@ -1102,6 +1105,8 @@ F43769E31AE7D01D00DE6204 /* HMUpdateQuestListCommand.m */, F402D5351BE3AFAB008D5881 /* HMSlotResetCommand.h */, F402D5361BE3AFAB008D5881 /* HMSlotResetCommand.m */, + F4F479241C074E9900D0BF69 /* HMCombinedCommand.h */, + F4F479251C074E9900D0BF69 /* HMCombinedCommand.m */, ); name = Command; sourceTree = ""; @@ -1312,6 +1317,7 @@ F4D6BCBA1AA32BEA00742FEB /* HMFleetViewController.m in Sources */, F49546311B18991300E0D8D0 /* HMBookmarkDataStore.m in Sources */, F4666C511B1CB2CE001840DB /* HMBrowserContentAdjuster.m in Sources */, + F4F479261C074E9900D0BF69 /* HMCombinedCommand.m in Sources */, F4E7802E18DC3AF00011BC4C /* LocalData.xcdatamodeld in Sources */, F4D6BCAD1AA2A60900742FEB /* HMSokuTransformer.m in Sources */, F4BEE4731AA5E34600979752 /* HMSlotItemFrameView.m in Sources */, diff --git a/KCD/HMCombinedCommand.h b/KCD/HMCombinedCommand.h new file mode 100644 index 00000000..1738c0c4 --- /dev/null +++ b/KCD/HMCombinedCommand.h @@ -0,0 +1,23 @@ +// +// HMCombinedCommand.h +// KCD +// +// Created by Hori,Masaki on 2015/11/26. +// Copyright (c) 2015å¹´ Hori,Masaki. All rights reserved. +// + +#import "HMJSONCommand.h" + +typedef NS_ENUM(NSUInteger, CombineType) { + cancel, + maneuver, + water, + transportation, +}; + +@interface HMCombinedCommand : HMJSONCommand + +@end + +extern NSString *HMCombinedCommandCombinedDidCangeNotification; +extern NSString *HMCombinedType; // NSNumber of CombineType diff --git a/KCD/HMCombinedCommand.m b/KCD/HMCombinedCommand.m new file mode 100644 index 00000000..9b7a45e5 --- /dev/null +++ b/KCD/HMCombinedCommand.m @@ -0,0 +1,40 @@ +// +// HMCombinedCommand.m +// KCD +// +// Created by Hori,Masaki on 2015/11/26. +// Copyright (c) 2015å¹´ Hori,Masaki. All rights reserved. +// + +#import "HMCombinedCommand.h" + + +NSString *HMCombinedCommandCombinedDidCangeNotification = @"HMCombinedCommandCombinedDidCangeNotification"; +NSString *HMCombinedType = @"HMCombinedType"; + +@implementation HMCombinedCommand ++ (void)load +{ + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + [HMJSONCommand registerClass:self]; + }); +} ++ (BOOL)canExcuteAPI:(NSString *)api +{ + if([api isEqualToString:@"/kcsapi/api_req_hensei/combined"]) return YES; + return NO; +} +- (void)execute +{ + id type = self.arguments[@"api_combined_type"]; + if(!type) return; + + NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; + [nc postNotificationName:HMCombinedCommandCombinedDidCangeNotification + object:self + userInfo:@{ + HMCombinedType : type + }]; +} +@end diff --git a/KCD/HMIgnoreCommand.m b/KCD/HMIgnoreCommand.m index 7bd48bd2..2e8b5e39 100644 --- a/KCD/HMIgnoreCommand.m +++ b/KCD/HMIgnoreCommand.m @@ -34,7 +34,6 @@ static NSArray *ignoreCommands = nil; @"/kcsapi/api_req_furniture/music_list", @"/kcsapi/api_req_furniture/music_play", @"/kcsapi/api_req_furniture/set_portbgm", - @"/kcsapi/api_req_hensei/combined", @"/kcsapi/api_req_hensei/lock", @"/kcsapi/api_req_hensei/preset_register", @"/kcsapi/api_req_kaisou/slotset", -- 2.11.0