jbcden_ttt 0.0.2 → 0.0.3

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: 36395505ce86cec4462793e9888f83720c15e56a
4
- data.tar.gz: cd5b15ef880bc37b89e19224acf2a3f1fcc2038e
3
+ metadata.gz: 653b7ee3e363afa9843027b90e635ded6cf45aee
4
+ data.tar.gz: 524cad18f026ae9631e87d782742ebcb35c3a161
5
5
  SHA512:
6
- metadata.gz: e59985b600f2bb61bea21fc44db97f25e2a018f7ab2e37e34107f9cabdd89161827c885103b9cab41b5c268582a94b373440fd03fd498f45a7a08780e7b81a94
7
- data.tar.gz: d2aa5598920366ea277482ebdbb73fcaf12dd7221db50d7fc73ba2fe29f3cf22cc39614f0613b5d40bd1c3e81bbbbad1f0aeca48ef13d9beb1aca8b7847da0ad
6
+ metadata.gz: a868944d7f3aa21a552186b04dcb1228fc20999df633ebf11fc864374e580e3531312ac1aa43adee7381d43b3a99c2602cb08add5f742815d9cb6afdf44e195a
7
+ data.tar.gz: d74c60b61a3d602af67af4fbe1f7cb5c0f1f79ad0b4825a35b90f179f78e5601cbaed615f2a82bc4d12912c854455da0afacf8f42e0ee6481b02176bd55f08f3
@@ -19,6 +19,16 @@ module JbcdenTtt
19
19
  DisplayBoard.call(board)
20
20
  end
21
21
 
22
+ def dup
23
+ # copy board class and deep copy the inner board array
24
+ # Marshal is necessary b/c board array does not contain
25
+ # Plain Old Ruby Objects
26
+ super.tap do
27
+ temp_board = Marshal.load(Marshal.dump(board))
28
+ self.board = temp_board
29
+ end
30
+ end
31
+
22
32
  def_delegators :@board, :[], :[]=, :each, :first, :size, :last
23
33
  private
24
34
 
@@ -87,12 +87,7 @@ module JbcdenTtt
87
87
  end
88
88
 
89
89
  def get_new_state(tile, game, current_player)
90
- # copy board class and deep copy the inner board array
91
- # Marshal is necessary b/c board array does not contain
92
- # Plain Old Ruby Objects
93
90
  temp_board = game.board.dup
94
- board_array = Marshal.load(Marshal.dump(game.board.board))
95
- temp_board.board = board_array
96
91
 
97
92
  temp_board[tile.xval][tile.yval].mark(current_player)
98
93
 
@@ -1,3 +1,3 @@
1
1
  module JbcdenTtt
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jbcden_ttt
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
  - Jacob Chae