Merge lp:~hjd/widelands/class-FileSystem into lp:widelands
Proposed by
Hans Joachim Desserud
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | 6488 | ||||
Proposed branch: | lp:~hjd/widelands/class-FileSystem | ||||
Merge into: | lp:widelands | ||||
Diff against target: |
198 lines (+19/-16) 13 files modified
src/game_io/game_data_packet.h (+1/-1) src/game_io/game_loader.h (+1/-1) src/game_io/game_saver.h (+1/-1) src/graphic/font_handler1.h (+1/-1) src/io/filesystem/disk_filesystem.h (+2/-1) src/io/filesystem/filesystem.h (+2/-1) src/io/filesystem/layered_filesystem.h (+4/-2) src/io/filesystem/zip_filesystem.h (+2/-3) src/map_io/widelands_map_data_packet.h (+1/-1) src/map_io/widelands_map_loader.h (+1/-1) src/map_io/widelands_map_object_packet.h (+1/-1) src/map_io/widelands_map_saver.h (+1/-1) src/profile/profile.h (+1/-1) |
||||
To merge this branch: | bzr merge lp:~hjd/widelands/class-FileSystem | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
SirVer | Approve | ||
Mark Scott | Approve | ||
Review via email: mp+142364@code.launchpad.net |
Description of the change
From my previous patch I got the impression classes were preferred. Therefore, here is a struct converted to class since it was referred to as both in different places.
To post a comment you must log in.
Looks fine.
Here's some information on struct vs class. It is purely a stylistic thing, but almost all code I've seen recently (outside of Widelands) uses class for anything that has methods or is vaguely C++ like. struct is only used for things that might be exchanged with C.
http:// www.cplusplus. com/forum/ beginner/ 5980/ stackoverflow. com/questions/ 54585/when- should- you-use- a-class- vs-a-struct- in-c
http://
You could go one further and change LayeredFileSystem, ZipFileSystem and the other derived classes of FileSystem.
(There's another reason - have you ever heard of someone talking about derived structs, or substructing vs subclassing?)