covid-sim icon indicating copy to clipboard operation
covid-sim copied to clipboard

Create Vector2 Struct

Open CloneDeath opened this issue 4 years ago • 5 comments

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.

CloneDeath avatar May 22 '20 15:05 CloneDeath

See #213

zebmason avatar May 23 '20 06:05 zebmason

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.

CloneDeath avatar May 26 '20 23:05 CloneDeath

@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.

CloneDeath avatar May 26 '20 23:05 CloneDeath

@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 avatar May 26 '20 23:05 CloneDeath

@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

zebmason avatar May 27 '20 05:05 zebmason