2 // HMRealDestroyShipCommand.m
5 // Created by Hori,Masaki on 2014/07/20.
6 // Copyright (c) 2014年 Hori,Masaki. All rights reserved.
9 #import "HMRealDestroyShipCommand.h"
13 @implementation HMRealDestroyShipCommand
16 HMServerDataStore *store = [HMServerDataStore oneTimeEditor];
17 NSManagedObjectContext *moc = store.managedObjectContext;
19 NSString *destroyedShipId = [self.arguments objectForKey:@"api_ship_id"];
22 NSArray *ships = [store objectsWithEntityName:@"Ship"
24 predicateFormat:@"id = %@", @([destroyedShipId integerValue])];
25 if(ships.count == 0) {
28 [moc deleteObject:ships[0]];