I went to add one more initialization value to the poor overworked constructor of my bloated "shoulda planned a tad more on paper first" / "do everything" Actor class:
The ThoughtFrequency(tf) at the end is what I added. Immediately I began to get this arcane (to me) compiler warning:Code:class Actor { public: Actor(double x = 0.0, double y = 0.0, double z = 0.0, double xlb = -1000.0, double xub = 1000.0, double ylb = -1000.0, double yub = 1000.0, double zlb = -1000.0, double zub = 1000.0, double sz = 1.0, int tf = 5) : xPos(x), yPos(y), zPos(z), xLowerBound(xlb), xUpperBound(xub), yLowerBound(ylb), yUpperBound(yub), zLowerBound(zlb), zUpperBound(zub), size(sz), ThoughtFrequency(tf) {} virtual ~Actor() {}; ...
And in a maybe unrelated coincidence - my program began to seg-fault intermittently on execution. I don't know why it'd matter what order these private variables are initialized in, so I must be misunderstanding something.Code:||=== Fri Oct 21, Debug ===| /storage/Projects/Recent/Fri Oct 21/actor.h||In constructor ‘Actor::Actor(double, double, double, double, double, double, double, double, double, double, int)’:| /storage/Projects/Recent/Fri Oct 21/actor.h|99|warning: ‘Actor::size’ will be initialized after| /storage/Projects/Recent/Fri Oct 21/actor.h|78|warning: ‘int Actor::ThoughtFrequency’| /storage/Projects/Recent/Fri Oct 21/actor.h|14|warning: when initialized here| /storage/Projects/Recent/Fri Oct 21/actor.h||In constructor ‘Actor::Actor(double, double, double, double, double, double, double, double, double, double, int)’:| /storage/Projects/Recent/Fri Oct 21/actor.h|99|warning: ‘Actor::size’ will be initialized after| /storage/Projects/Recent/Fri Oct 21/actor.h|78|warning: ‘int Actor::ThoughtFrequency’| /storage/Projects/Recent/Fri Oct 21/actor.h|14|warning: when initialized here| ||=== Build finished: 0 errors, 6 warnings ===|
(Additionally, in an unrelated commentary, I do plan to re-factor this all out from Class Actor into something like Entity->Camera , Entity->Actor, Actor->Player, Actor->Enemy eventually. Inheritance is newer to me. This won't always be a bloated mess.)
Please, I'm afraid and alone - the walls of my computer room are turning black and rising up around me, shutting out the sun. As always I appreciate any incite from the community here.
- Matt



LinkBack URL
About LinkBacks


