Page 1 of 1

Refactoring class interface to make GAME SAVE avaliable

PostPosted: 03 Mar 2012, 14:21
by paul424
As in topic, having looked briefly at code there is no "GAME SAVE" feature at present.

At least each persistent object should have a method Object_Type:: ObjectType_Memento makeMemento() and constructor Object_T:: object( Object_T_Memento ).
And also a FileSaveReader, FileSaveWriter.

The binary format might be : List of pairs : <ObjectType1, ObjectType1_Memento; ObjectType2, ObjectType2_Memento; ..... ObjectTn, Object_Tn_Memento >.

Someone should have a loook what Pattern Design has to say on that topic.

Re: Refactoring class interface to make GAME SAVE avaliable

PostPosted: 05 Mar 2012, 14:15
by svenskmand
The pattern your looking for is probably the Command Pattern.