@property (readonly) NSNumber *totalSakuteki;
@property (readonly) NSNumber *totalSeiku;
+@property (readonly) NSNumber *totalCalclatedSeiku;
- (IBAction)selectNextFleet:(id)sender;
- (IBAction)selectPreviousFleet:(id)sender;
}
return @(total);
}
++ (NSSet *)keyPathsForValuesAffectingTotalCalclatedSeiku
+{
+ return [NSSet setWithObjects:
+ @"detail01.ship.seiku",
+ @"detail02.ship.seiku",
+ @"detail03.ship.seiku",
+ @"detail04.ship.seiku",
+ @"detail05.ship.seiku",
+ @"detail06.ship.seiku",
+ nil];
+}
+- (NSNumber *)totalCalclatedSeiku
+{
+ NSInteger total = 0;
+ for(HMShipDetailViewController *detail in self.details) {
+ HMKCShipObject *ship = detail.ship;
+ total += ship.seiku.integerValue;
+ total += ship.extraSeiku.integerValue;
+ }
+ return @(total);
+}
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
{
@property (readonly) NSNumber *totalEquipment;
@property (readonly) NSNumber *seiku;
+@property (readonly) NSNumber *extraSeiku;
@property (readonly) NSNumber *guardEscaped; // NSNumber of BOLL
@end
@"onslot_0", @"onslot_1", @"onslot_2", @"onslot_3", @"onslot_4",
nil];
}
-- (NSNumber *)seiku
+
+- (HMKCSlotItemObject *)slotItemAtIndex:(NSUInteger)index
{
HMServerDataStore *store = [HMServerDataStore defaultManager];
+
+ NSString *key = [NSString stringWithFormat:@"slot_%ld", index];
+ NSNumber *itemId = [self valueForKey:key];
+ if(itemId.integerValue == -1) return nil;
+ NSError *error = nil;
+ NSArray *array = [store objectsWithEntityName:@"SlotItem"
+ error:&error
+ predicateFormat:@"id = %@", itemId];
+ if(array.count == 0) return nil;
+ HMKCSlotItemObject *slotItem = array[0];
+ return slotItem;
+}
+- (NSNumber *)seiku
+{
NSArray *effectiveTypes = @[@6, @7, @8, @11];
__block NSInteger totalSeiku = 0;
for(NSInteger i = 0; i < 5; i++) {
- NSString *key = [NSString stringWithFormat:@"slot_%ld", i];
- NSNumber *itemId = [self valueForKey:key];
- if(itemId.integerValue == -1) break;
- NSError *error = nil;
- NSArray *array = [store objectsWithEntityName:@"SlotItem"
- error:&error
- predicateFormat:@"id = %@", itemId];
- if(array.count == 0) continue;
- HMKCSlotItemObject *slotItem = array[0];
+ HMKCSlotItemObject *slotItem = [self slotItemAtIndex:i];
HMKCMasterSlotItemObject *master = slotItem.master_slotItem;
NSNumber *type2 = master.type_2;
if(![effectiveTypes containsObject:type2]) {
continue;
}
- key = [NSString stringWithFormat:@"onslot_%ld", i];
+ NSString *key = [NSString stringWithFormat:@"onslot_%ld", i];
NSNumber *itemCountValue = [self valueForKey:key];
NSNumber *taikuValue = master.tyku;
NSInteger itemCount = [itemCountValue integerValue];
return @(totalSeiku);
}
-
+- (NSNumber *)extraSeiku
+{
+ NSArray *fighterTypes = @[@6];
+ NSArray *bomberTypes = @[@7];
+ NSArray *attackerTypes = @[@8];
+ NSArray *floatplaneBomberTypes = @[@11];
+ __block NSInteger extraSeiku = 0;
+ for(NSInteger i = 0; i < 5; i++) {
+ HMKCSlotItemObject *slotItem = [self slotItemAtIndex:i];
+ NSNumber *airLevel = slotItem.alv;
+ if(![airLevel isEqualToNumber:@(7)]) continue;
+
+ NSString *key = [NSString stringWithFormat:@"onslot_%ld", i];
+ NSNumber *itemCountValue = [self valueForKey:key];
+ NSInteger itemCount = [itemCountValue integerValue];
+ if(itemCount == 0) continue;
+
+ HMKCMasterSlotItemObject *master = slotItem.master_slotItem;
+ NSNumber *type2 = master.type_2;
+ if([fighterTypes containsObject:type2]) {
+ extraSeiku += 25;
+ }
+ if([bomberTypes containsObject:type2]) {
+ extraSeiku += 3;
+ }
+ if([attackerTypes containsObject:type2]) {
+ extraSeiku += 3;
+ }
+ if([floatplaneBomberTypes containsObject:type2]) {
+ extraSeiku += 9;
+ }
+ }
+
+ return @(extraSeiku);
+}
- (NSNumber *)guardEscaped
{
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="7706" systemVersion="14E46" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="7706" systemVersion="14F27" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="7706"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="Tek-2X-Nz2">
- <rect key="frame" x="760" y="23" width="29" height="17"/>
+ <rect key="frame" x="757" y="39" width="29" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="999" id="YR1-Zf-z2o">
<font key="font" metaFont="system"/>
</connections>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="M1a-LI-gu8">
- <rect key="frame" x="707" y="23" width="56" height="17"/>
+ <rect key="frame" x="704" y="39" width="56" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="索敵値:" id="8vd-Ce-2wt">
<font key="font" metaFont="system"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="M7E-Fw-i73">
- <rect key="frame" x="707" y="2" width="56" height="17"/>
+ <rect key="frame" x="704" y="18" width="56" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="制空値:" id="Qbb-Ik-rgd">
<font key="font" size="13" name="HiraKakuProN-W3"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="cTt-4n-W3p">
- <rect key="frame" x="760" y="2" width="29" height="17"/>
+ <rect key="frame" x="757" y="18" width="29" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="999" id="Yci-02-wdB">
<font key="font" metaFont="system"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
<connections>
- <binding destination="-2" name="displayPatternValue1" keyPath="repairableShipCount" id="jQC-B7-xag">
+ <binding destination="-2" name="hidden" keyPath="repairableShipCount" id="04h-bb-EMw">
<dictionary key="options">
- <string key="NSDisplayPattern">%{value1}@隻</string>
+ <string key="NSValueTransformerName">NSNegateBoolean</string>
</dictionary>
</binding>
- <binding destination="-2" name="hidden" keyPath="repairableShipCount" id="04h-bb-EMw">
+ <binding destination="-2" name="displayPatternValue1" keyPath="repairableShipCount" id="jQC-B7-xag">
<dictionary key="options">
- <string key="NSValueTransformerName">NSNegateBoolean</string>
+ <string key="NSDisplayPattern">%{value1}@隻</string>
</dictionary>
</binding>
</connections>
</binding>
</connections>
</textField>
+ <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="egC-s0-Spl">
+ <rect key="frame" x="754" y="4" width="35" height="17"/>
+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+ <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="(999)" id="9jV-Tr-HbF">
+ <font key="font" metaFont="system"/>
+ <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+ <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
+ </textFieldCell>
+ <connections>
+ <binding destination="-2" name="displayPatternValue1" keyPath="totalCalclatedSeiku" id="ypd-Ik-qlQ">
+ <dictionary key="options">
+ <string key="NSDisplayPattern">(%{value1}@)</string>
+ </dictionary>
+ </binding>
+ </connections>
+ </textField>
</subviews>
<point key="canvasLocation" x="139.5" y="169"/>
</customView>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="7706" systemVersion="14E46" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="7706" systemVersion="14F27" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="7706"/>
</connections>
</matrix>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="GMS-aA-S7M">
- <rect key="frame" x="318" y="263" width="164" height="17"/>
+ <rect key="frame" x="312" y="263" width="181" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="012345678901234567890" id="pRI-rA-JGD">
<font key="font" metaFont="system"/>
</connections>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="f8W-G4-mOr">
- <rect key="frame" x="620" y="263" width="56" height="17"/>
+ <rect key="frame" x="618" y="264" width="48" height="14"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
- <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="索敵値:" id="vA3-9F-FLk">
- <font key="font" metaFont="system"/>
+ <textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="索敵値:" id="vA3-9F-FLk">
+ <font key="font" metaFont="smallSystem"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="mUy-1k-ALk">
- <rect key="frame" x="671" y="263" width="29" height="17"/>
+ <rect key="frame" x="661" y="263" width="29" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="999" id="HeX-Wd-ikA">
<numberFormatter key="formatter" formatterBehavior="default10_4" usesGroupingSeparator="NO" groupingSize="0" minimumIntegerDigits="0" maximumIntegerDigits="42" id="ntt-Mj-4hA"/>
</connections>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="ee5-Xk-4iW">
- <rect key="frame" x="710" y="263" width="56" height="17"/>
+ <rect key="frame" x="692" y="264" width="48" height="14"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
- <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="制空値:" id="dS3-tO-y1s">
- <font key="font" metaFont="system"/>
+ <textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="制空値:" id="dS3-tO-y1s">
+ <font key="font" metaFont="smallSystem"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="Jhy-EA-ust">
- <rect key="frame" x="761" y="263" width="29" height="17"/>
+ <rect key="frame" x="735" y="263" width="61" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
- <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="999" id="ytq-FR-96e">
- <numberFormatter key="formatter" formatterBehavior="default10_4" usesGroupingSeparator="NO" groupingSize="0" minimumIntegerDigits="0" maximumIntegerDigits="42" id="NZH-vE-NqR"/>
+ <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="999 (999)" id="ytq-FR-96e">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
<connections>
- <binding destination="-2" name="value" keyPath="totalSeiku" id="rv3-ob-Fyz"/>
+ <binding destination="-2" name="displayPatternValue1" keyPath="totalSeiku" id="ucj-A3-qBe">
+ <dictionary key="options">
+ <string key="NSDisplayPattern">%{value1}@ (%{value2}@)</string>
+ </dictionary>
+ </binding>
+ <binding destination="-2" name="displayPatternValue2" keyPath="totalCalclatedSeiku" previousBinding="ucj-A3-qBe" id="VyW-d3-E9s">
+ <dictionary key="options">
+ <string key="NSDisplayPattern">%{value1}@ (%{value2}@)</string>
+ </dictionary>
+ </binding>
</connections>
</textField>
<customView id="jG7-Xp-ypT">
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
</customView>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="tzQ-Ab-vcB">
- <rect key="frame" x="559" y="264" width="55" height="14"/>
+ <rect key="frame" x="561" y="264" width="55" height="14"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
- <textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" placeholderString="" id="cM2-uj-Gqv">
+ <textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" placeholderString="" id="cM2-uj-Gqv">
<customFormatter key="formatter" id="pgG-gM-Tpw" customClass="HMTimerCountFormatter"/>
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
</connections>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="uUF-rx-r0B">
- <rect key="frame" x="538" y="264" width="22" height="14"/>
+ <rect key="frame" x="541" y="264" width="22" height="14"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="5隻" placeholderString="" id="A7x-BU-zBz">
<font key="font" metaFont="smallSystem"/>
</connections>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="IdS-vy-Vuk">
- <rect key="frame" x="491" y="264" width="48" height="14"/>
+ <rect key="frame" x="495" y="264" width="48" height="14"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="泊地修理" placeholderString="" id="kMw-Op-KQt">
<font key="font" metaFont="smallSystem"/>