shogi-server source
修订版 | d1a385928c33bc160b9a2d77994c8f5f4c876fe7 (tree) |
---|---|
时间 | 2008-10-08 22:38:18 |
作者 | beatles <beatles@b8c6...> |
Commiter | beatles |
Back to Marshal for deep copy.
@@ -34,20 +34,7 @@ class Board | ||
34 | 34 | attr_reader :move_count |
35 | 35 | |
36 | 36 | def deep_copy |
37 | - # return Marshal.load(Marshal.dump(self)) | |
38 | - board = Board.new(self.move_count) | |
39 | - board.sente_hands = self.sente_hands.clone | |
40 | - board.gote_hands = self.gote_hands.clone | |
41 | - board.history = self.history.clone | |
42 | - board.history.default = 0 | |
43 | - board.sente_history = self.sente_history.clone | |
44 | - board.sente_history.default = 0 | |
45 | - board.gote_history = self.gote_history.clone | |
46 | - board.gote_history.default = 0 | |
47 | - board.array = [] | |
48 | - self.array.each {|a| board.array.push(a.clone)} | |
49 | - board.teban = self.teban | |
50 | - return board | |
37 | + return Marshal.load(Marshal.dump(self)) | |
51 | 38 | end |
52 | 39 | |
53 | 40 | def initial |