Closed OrianaVenture closed 10 months ago
Thanks, it looks really good. Especially using the ClassMember
to find fields on the child, which makes it much more generic.
Using __
as a separator instead of a single underscore is also a good idea to keep the names intact and feels natural to use.
While testing with the VikingShip
, a child name can be ambiguous, e.g. mast
is used for both the mesh and the interactive child. The interactive child is nested shallower and therefore found first. Intermediate children could be a solution, so maybe JVLmock_VikingShip__ship__mast
to match the ship
child first and then the mast
child.
With more complex matching, the warnings should also be more specific. For example, if a child wasn't found should print a different warning than if the type on the child wasn't found. If you don't want to worry about this, I can also do this later.
There are a few minor comments I will make on the code but this won't be a blocker.
Current minor suggestions have been implemented. I will look into making the pathing more dynamic to accept more nesting for cases like: JVLmock_VikingShipshipmast and work on better error logging for that case.
Testing this on my current mocked locations the startup time is significantly slower than my stand alone solution which had caching. Next improvement will be to add in the ability to cache all instances with the longer path finding names after finding them once.
Since there are many unnamed Mesh objects used the current mocking system can not replace them. This is the required changes to get a functioning mesh mocking system, but should work for other types too.
Examples of usage: