Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify Dat::Item classes #510

Open
phobos2077 opened this issue Apr 2, 2017 · 0 comments
Open

Simplify Dat::Item classes #510

phobos2077 opened this issue Apr 2, 2017 · 0 comments
Labels
Milestone

Comments

@phobos2077
Copy link
Contributor

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
@phobos2077 phobos2077 added the code label Apr 2, 2017
@phobos2077 phobos2077 added this to the 0.9.0 milestone Apr 2, 2017
@phobos2077 phobos2077 changed the title Use simpler interface for Dat::Item classes Simplify Dat::Item classes Apr 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant