You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently all descendants of Dat::Item use trivial getters and setters for accessing data.
This makes no sense, because the sole purpose of these classes is to hold information from Fallout resource files. Getters imply encapsulation of some kind of logic, but in this case it just makes code harder to understand.
Suggestions:
Use struct keyword indicating that we are dealing with simple collection of data
Replace all getters/setters for file formats and related structs with simple public properties
Replace all uses of "vector of pointers" with simpler "vector of objects". We don't need polymorphism here and vectors of pointers just require unnecessary memory allocations, increasing load times.
Consider moving the logic of loading the data from files into separate factory functions/classes in order to separate concerns and make Format classes even simpler
The text was updated successfully, but these errors were encountered:
Currently all descendants of Dat::Item use trivial getters and setters for accessing data.
This makes no sense, because the sole purpose of these classes is to hold information from Fallout resource files. Getters imply encapsulation of some kind of logic, but in this case it just makes code harder to understand.
Suggestions:
struct
keyword indicating that we are dealing with simple collection of dataThe text was updated successfully, but these errors were encountered: