admiral_stats_parser 0.1.6 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9e5ff7fec872328d25fbe2d5cdd120ed2537e0ee
4
- data.tar.gz: 88619cde06ff2d7fc43eff9b8706887729dfd981
3
+ metadata.gz: 21c3548c1043a396927fd0e6893258b699303d6c
4
+ data.tar.gz: 9306cca5e82f639df4286f0d477b2c74643ebc58
5
5
  SHA512:
6
- metadata.gz: 10e51e7510ede251bfda79bc2e2b6bce88c0e9483d412fa9943d67b7d4473c3b51517e15f56fc91e323b987c63d095b335721d2620a99ed1afcc664949e15506
7
- data.tar.gz: 32093c6b47e575c71dd2976edce24504ec8c337e46fad1f817416aeec0cf95a40c58cd793ad8244db7b104428f895fcbb48d409a958cd4b5928beacf67652370
6
+ metadata.gz: a246e7a4560863fb3dfebdf0f337791deb08bcdc5d711bdd6b36a035077d5bfaaaba647743f1508aa44d73f08c66effc72b3d8d3c3dd2e609f725b0c5fc0e4b7
7
+ data.tar.gz: 470107dac29c48e72f892e5b85664a53a9c91951d134d80e34d369b50d24dc576cd7b6befd07d6c053bec59e2c16cfd18e09afd1235a7a0a0bc8ca43f5b388aa
@@ -136,7 +136,8 @@ class EventInfoParser
136
136
  list = event_info_list.select{|info| info.level == level }
137
137
 
138
138
  # その周回をクリア済みかどうか
139
- cleared = ( list.select{|i| i.area_clear_state == 'NOTCLEAR' }.size == 0 )
139
+ # 最初の海域が 'NOOPEN' でなく、かつ 'NOTCLEAR' の海域が存在しない場合はクリア済み
140
+ cleared = ( list.first.area_clear_state != 'NOOPEN' and list.select{|i| i.area_clear_state == 'NOTCLEAR' }.size == 0 )
140
141
 
141
142
  # 現在の周回数
142
143
  loop_count = list.map{|i| i.loop_count }.max
@@ -151,6 +152,9 @@ class EventInfoParser
151
152
  # 指定されたレベルの情報を、サブ海域番号の小さい順に取り出し
152
153
  list = event_info_list.select{|info| info.level == level}.sort_by {|info| info.area_sub_id }
153
154
 
155
+ # 最初の海域が NOOPEN の場合は、難易度自体が開放されていないため、0 を返す
156
+ return 0 if list.first.area_clear_state == 'NOOPEN'
157
+
154
158
  list.each_with_index do |info, prev_stage_no|
155
159
  return prev_stage_no if info.area_clear_state == 'NOTCLEAR'
156
160
  end
@@ -166,7 +170,7 @@ class EventInfoParser
166
170
  list = event_info_list.select{|info| info.level == level}.sort_by {|info| info.area_sub_id }
167
171
 
168
172
  list.each_with_index do |info, prev_stage_no|
169
- if info.area_clear_state == 'NOTCLEAR'
173
+ if info.area_clear_state == 'NOTCLEAR' or info.area_clear_state == 'NOOPEN'
170
174
  return info.military_gauge_left
171
175
  end
172
176
  end
@@ -1,3 +1,3 @@
1
1
  module AdmiralStatsParser
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: admiral_stats_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masahiro Yoshizawa
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-10-31 00:00:00.000000000 Z
11
+ date: 2016-11-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler