mirror of
https://github.com/shlomif/PySolFC.git
synced 2025-04-05 00:02:29 -04:00
fix load/save
This commit is contained in:
parent
74016ff224
commit
8078db9abc
1 changed files with 5 additions and 3 deletions
|
@ -3149,7 +3149,9 @@ class Game(object):
|
||||||
# accept old storage format in case:
|
# accept old storage format in case:
|
||||||
if (t == GameMoves
|
if (t == GameMoves
|
||||||
or t == GameGlobalStatsStruct
|
or t == GameGlobalStatsStruct
|
||||||
or t == GameStatsStruct):
|
or t == GameStatsStruct
|
||||||
|
or t == GameSaveInfo
|
||||||
|
or t == GameGlobalSaveInfo):
|
||||||
assert isinstance(obj, Struct), err_txt
|
assert isinstance(obj, Struct), err_txt
|
||||||
else:
|
else:
|
||||||
assert False, err_txt
|
assert False, err_txt
|
||||||
|
@ -3215,9 +3217,9 @@ class Game(object):
|
||||||
game.loadinfo.talon_round = pload()
|
game.loadinfo.talon_round = pload()
|
||||||
game.finished = pload()
|
game.finished = pload()
|
||||||
if 0 <= bookmark <= 1:
|
if 0 <= bookmark <= 1:
|
||||||
saveinfo = pload(Struct)
|
saveinfo = pload(GameSaveInfo)
|
||||||
game.saveinfo.__dict__.update(saveinfo.__dict__)
|
game.saveinfo.__dict__.update(saveinfo.__dict__)
|
||||||
gsaveinfo = pload(Struct)
|
gsaveinfo = pload(GameGlobalSaveInfo)
|
||||||
game.gsaveinfo.__dict__.update(gsaveinfo.__dict__)
|
game.gsaveinfo.__dict__.update(gsaveinfo.__dict__)
|
||||||
moves = pload(GameMoves)
|
moves = pload(GameMoves)
|
||||||
game.moves.__dict__.update(moves.__dict__)
|
game.moves.__dict__.update(moves.__dict__)
|
||||||
|
|
Loading…
Add table
Reference in a new issue