Review: Needs Fixing

I think this is the wrong approach - the LuaClass does not have any data 
members, so it should not persist anything at all. The MapView (c++ class) 
should save its data to save games one day, so that you have the same view and 
so on when loading. 

For the Lua fix here, all clases that can get a handle again on the c++ class 
on a reaload should overwrite the __persists methods which basically does 
nothing.

The logic here is: if you have a handle to a Window (e.g. a building window of 
any building) in a lua variable and the game is saved what should the window 
persist? It cannot reopen the window again after reload (since there is no 
open_window(name) method), the reloaded game will not have opened the window 
too, so the variable would contain crap after reloading. For the MapView this 
is not true: you can always get a hold on the map view again, because there is 
always a singular one available.

mmh, I fear this was not very well explained. Do you still get what I mean?
-- 
https://code.launchpad.net/~widelands-dev/widelands/lua_mapview_persistence/+merge/177251
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/lua_mapview_persistence.

_______________________________________________
Mailing list: https://launchpad.net/~widelands-dev
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp

Reply via email to