2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 12:27:43 +00:00

CCollisionPrimitive: Simplify the InitAdd* member functions

We can extract the duplicated behavior out into its own member function
and then reuse it in order to deduplicate repeated behavior.

This allows simplifying the member functions in a manner that allows
declaring most of the variables const. The lack of mutable behavior
within these functions makes it much nicer to read.
This commit is contained in:
Lioncash
2019-10-11 23:19:48 -04:00
parent c4ecf972f5
commit 5f4aba60e1
2 changed files with 47 additions and 60 deletions

View File

@@ -122,6 +122,10 @@ private:
static BooleanComparisonFunc sNullBooleanCollider;
static MovingComparisonFunc sNullMovingCollider;
// Attempts to locate an entry within the collision type list that matches the supplied name.
// Returns the end iterator in the event of no matches.
static std::vector<Type>::const_iterator FindCollisionType(const char* name);
static bool InternalCollide(const CInternalCollisionStructure& collision, CCollisionInfoList& list);
static bool InternalCollideBoolean(const CInternalCollisionStructure& collision);
static bool InternalCollideMoving(const CInternalCollisionStructure& collision, const zeus::CVector3f& dir,