boardgame 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 50e8701bd4c774018c21325cac815432198fb853
4
- data.tar.gz: 737e1ba9be6afd445915261a6a17822468eb7ee8
3
+ metadata.gz: 197702a376fd38b428abd963104e7f8c3af5100c
4
+ data.tar.gz: c793518ac7b25371d1644f418e0a5f97ed6e308b
5
5
  SHA512:
6
- metadata.gz: 283990e26001cd59672413495006d8f763c7847e318d189b48862dca78f373dde5e52faa10939d23ef85614d1dbf975271d603a71ec57f3e516993a73217b7a9
7
- data.tar.gz: ff5d6458f6b7c414f938a39ba035d24686efee41054f3f22950e02a89889ea1b9341db61ff5e37c92698b887b88041d82989c93e04ad18e8cc3a6046cc46a8c8
6
+ metadata.gz: d6d9da533d8db374efb0493024cae7f1c15b09c34a09a8d1ac35e67cfa9438dfa10e8a3c4f07f6ee17f765f964058f5fd766098db22f2c8ea282a868dcacd1b3
7
+ data.tar.gz: 4c008cb0785f2b70ad7d5efe1f0b797f409cc596cb4309ddb3074400e5de184c19349d6249b69f2b52e8ef6d1df45a1fae1c55b143f3d9c545ba6d6dddfaf846
@@ -11,5 +11,5 @@ Gem::Specification.new do |s|
11
11
  s.require_paths = ['lib']
12
12
  s.summary = "Control logic for board and tile based games using Ruby."
13
13
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
14
- s.version = '0.0.2'
14
+ s.version = '0.0.3'
15
15
  end
@@ -42,6 +42,10 @@ class BoardGame::Map
42
42
  return buffer
43
43
  end
44
44
 
45
+ def as_json(*args)
46
+ tiles.as_json
47
+ end
48
+
45
49
  private
46
50
 
47
51
  def initialize_map_tiles
@@ -13,4 +13,8 @@ class BoardGame::Piece
13
13
  def inspect
14
14
  "+"
15
15
  end
16
+
17
+ def as_json(*args)
18
+ "+"
19
+ end
16
20
  end
@@ -29,4 +29,10 @@ class BoardGame::Tile
29
29
  piece.tile = nil
30
30
  @content.delete piece
31
31
  end
32
+
33
+ def as_json(*args)
34
+ {x: @x,
35
+ y: @y,
36
+ content: @content}
37
+ end
32
38
  end
data/readme.md CHANGED
@@ -32,5 +32,5 @@ home_tile << knight
32
32
  knight.move_to map[0, 0]
33
33
 
34
34
  #remove from the board
35
- home_tile.remove(knight)
35
+ map[0, 0].remove(knight)
36
36
  ```
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: boardgame
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rick Carlino