AbstractionAnon, thanks; that seems to be the solution. The examples in my OP didn't reflect the complexity of my actual code; I was simply trying to illustrate the problem.
As it turns out, just placing a member object inside would do the trick. I was aware of that method, but was looking at the problem the wrong way.
Here's the thing; I have a class that, when instantiated, creates an object which is responsible for all random-number generation in the program:
1 2 3 4 5 6 7 8 9 10
|
class Random
{
public:
Random()
{
setRand();
}
void setRand();
int getRand(int max);
};
|
Then, there is another class, which is a "player" object, which contains all of the player-attributes, as well as functions related to the player. This keeps everything in a nice, portable bundle that I can port elsewhere, if needed.
What I was hoping for, was a way to get the player-class to 'talk' to the 'random' class, to simplify the end-code.
I'll go with your suggestion, as there doesn't seem to be an alternative.
Cheers!