lacuna 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lacuna.rb +4 -0
- data/lib/lacuna/extras/archaeology.rb +16 -0
- data/lib/lacuna/extras/body.rb +10 -1
- data/lib/lacuna/extras/empire.rb +4 -1
- data/lib/lacuna/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1fb6c30f85f48ab7b6cb59c55af8707989b0bf1
|
4
|
+
data.tar.gz: 4d5a0f972c2c8ba68fb93defe86882f895bedc2d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 97ef45b85683ac522aba50473946b6a8919984594359c6c013ad8446fd52edc87d43cb49addf549b1cdca27a3c8300fe1b515aa5f7c85cbaae6eeffa22293b8e
|
7
|
+
data.tar.gz: 94a1cdeabcf51da50f8b304062f7c849eefa5f7b1c01d56584bd389d748757097247190d3c482f8bf38379e8a1d6078d3482ee1cba6def27006b4a242fe717ec
|
data/lib/lacuna.rb
CHANGED
@@ -79,6 +79,10 @@ module Lacuna
|
|
79
79
|
@module_name = 'captcha'
|
80
80
|
end
|
81
81
|
|
82
|
+
class Archaeology < Lacuna::Extras::Archaeology
|
83
|
+
@module_name = 'archaeology'
|
84
|
+
end
|
85
|
+
|
82
86
|
# Note: this has no support for building specific extras. I guess we could
|
83
87
|
# just define them manually?
|
84
88
|
Lacuna::Buildings.types.each do |name|
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
class Lacuna
|
4
|
+
class Extras
|
5
|
+
class Archaeology
|
6
|
+
def self.get_inventory(id)
|
7
|
+
glyphs = Lacuna::Archaeology.get_glyph_summary(id)['glyphs']
|
8
|
+
inventory = {}
|
9
|
+
glyphs.each do |glyph|
|
10
|
+
inventory[glyph['name']] = glyph['quantity'].to_i
|
11
|
+
end
|
12
|
+
inventory
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
data/lib/lacuna/extras/body.rb
CHANGED
@@ -3,7 +3,16 @@
|
|
3
3
|
module Lacuna
|
4
4
|
class Extras
|
5
5
|
class Body < Lacuna::Module
|
6
|
-
|
6
|
+
def self.find_building(buildings, name)
|
7
|
+
building = buildings.select do |id, building|
|
8
|
+
# Save the id for later
|
9
|
+
buildings[id]['id'] = id
|
10
|
+
building['name'] == name
|
11
|
+
end
|
12
|
+
# Grab the first item in the hash.
|
13
|
+
building = building[building.keys[0]]
|
14
|
+
building
|
15
|
+
end
|
7
16
|
end
|
8
17
|
end
|
9
18
|
end
|
data/lib/lacuna/extras/empire.rb
CHANGED
data/lib/lacuna/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lacuna
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan McCallum
|
@@ -19,6 +19,7 @@ files:
|
|
19
19
|
- lib/lacuna.rb
|
20
20
|
- lib/lacuna/constants.rb
|
21
21
|
- lib/lacuna/extras/alliance.rb
|
22
|
+
- lib/lacuna/extras/archaeology.rb
|
22
23
|
- lib/lacuna/extras/body.rb
|
23
24
|
- lib/lacuna/extras/buildings.rb
|
24
25
|
- lib/lacuna/extras/captcha.rb
|