• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

shogi-server source


Commit MetaInfo

修订版d1a385928c33bc160b9a2d77994c8f5f4c876fe7 (tree)
时间2008-10-08 22:38:18
作者beatles <beatles@b8c6...>
Commiterbeatles

Log Message

Back to Marshal for deep copy.

  • previous implementatoin was wrong.
  • No longer need to avoid Marshal since only the files related with Floodgate
    are reloaded.

更改概述

差异

--- a/shogi_server/board.rb
+++ b/shogi_server/board.rb
@@ -34,20 +34,7 @@ class Board
3434 attr_reader :move_count
3535
3636 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))
5138 end
5239
5340 def initial