Refactoring class interface to make GAME SAVE avaliable

Refactoring class interface to make GAME SAVE avaliable

Postby paul424 » 03 Mar 2012, 14:21

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.
User avatar
paul424
OD Moderator
 
Posts: 660
Joined: 24 Jan 2012, 13:54

Re: Refactoring class interface to make GAME SAVE avaliable

Postby svenskmand » 05 Mar 2012, 14:15

The pattern your looking for is probably the Command Pattern.
Jamendo.com - The best music store on the net, uses CC licenses.
User avatar
svenskmand
OD Moderator
 
Posts: 1850
Joined: 09 Dec 2009, 00:07
Location: Denmark

Who is online

Users browsing this forum: No registered users and 1 guest