reinforce 0.3.2 → 0.4.0
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 +4 -4
- data/lib/reinforce/command.rb +3 -2
- data/lib/reinforce/factory.rb +6 -2
- data/lib/reinforce/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0dbb936bd23637321c7c067014202777a82fd047abdb1f64614ac4d640691345
|
4
|
+
data.tar.gz: 883ca0c1b22859a9f247a5d5469f21bf1e41730116c7857fe7fdc157c33c7834
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c5ab91f9de91f1870fab2ec6b4e18b8332611d7acd4a6530d453e135f73e80558589eb5c234fae9b99d644258b85fa71d49a9d677091058810191b78ea9a25a
|
7
|
+
data.tar.gz: e4a8535ee8d6f83a4761acb5137dd1267c676f7c3ebc9d60eb50c606213b94df746f354e01a31b3335eda1c36a560996799c7755990958354f6fec325981b336
|
data/lib/reinforce/command.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
module Reinforce
|
4
4
|
class Command
|
5
|
-
attr_reader :action_type, :tick, :source, :index, :details
|
5
|
+
attr_reader :action_type, :tick, :source, :queue_index, :index, :details
|
6
6
|
|
7
7
|
PBGID_MAX = 2_147_483_648
|
8
8
|
|
@@ -12,7 +12,8 @@ module Reinforce
|
|
12
12
|
@tick = command_hash.values.first[:tick]
|
13
13
|
@pbgid = command_hash.values.first[:pbgid]
|
14
14
|
@source = command_hash.values.first[:source_identifier]
|
15
|
-
@
|
15
|
+
@queue_index = command_hash.values.first[:queue_index]
|
16
|
+
@index = command_hash.values.first[:index]
|
16
17
|
@details = Reinforce.dictionary.get_by_pbgid(@pbgid, build: build_number)
|
17
18
|
@cancelled = false
|
18
19
|
@suspect_from_tick = nil
|
data/lib/reinforce/factory.rb
CHANGED
@@ -74,7 +74,7 @@ module Reinforce
|
|
74
74
|
if command.action_type == 'CancelConstruction'
|
75
75
|
@buildings.reject(&:suspect?).each { |building| building.mark_suspect(command.tick) }
|
76
76
|
else
|
77
|
-
@productions[command.source][command.
|
77
|
+
@productions[command.source][command.queue_index - 1].cancel
|
78
78
|
end
|
79
79
|
|
80
80
|
true
|
@@ -90,7 +90,11 @@ module Reinforce
|
|
90
90
|
|
91
91
|
def consolidate
|
92
92
|
build = @buildings + @battlegroup + @takeover + @productions.values.flatten
|
93
|
-
build.
|
93
|
+
build.sort do |a, b|
|
94
|
+
order = a.tick <=> b.tick
|
95
|
+
order = a.index <=> b.index if order.zero?
|
96
|
+
order
|
97
|
+
end
|
94
98
|
end
|
95
99
|
|
96
100
|
# rubocop:disable Metrics/AbcSize
|
data/lib/reinforce/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: reinforce
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ryantaylor
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-09-
|
11
|
+
date: 2024-09-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: vault_coh
|