covid-sim
covid-sim copied to clipboard
Create Vector2 Struct
Refactor a lot of xy logic into some basic structures. This includes a Vector2 and Size struct to hold x,y coordinates, as well as width/height.
See #213
I strongly encourage the use of namespaces as appropriate.
I placed namespaces around the Geometry and Model classes. I don't think it's great, but it's a start.
I'd like to dive deeper into better namespaces and more organization later, but for now, I think this is a good first step.
@matt-gretton-dann
I also don't like lots of little header files.
I think the files in Geometry should be kept apart, as their differences are significant enough, and I wouldn't want people to confuse (for example) a function for Vector2 with Size.
As for the Models, I believe that as we start refactoring more and more functions into these classes, that their disparity will grow. However, as it stands, a few are still very small and similar. So, if you think we should merge some of these classes, let me know, and I'll get on it right away.
@zebmason
See #213
This avoids the issue of bringing in a third party library, but I did like your name Geometry
for the namespace.
This PR has gotten very large, but I have skimmed through that PR and saw a few things I'd like to pull over too.
Is there anything specifically you think should go in this PR, and not wait for a followup?
@CloneDeath I found with #213 that it just started to grow and grow then the merge conflicts turned it to hell. I like the bounding box code that I wrote as it actually flagged up and inconsistency in the code #268