Followers 0

Class within a Class

1 post in this topic

Hey guys.

As far as I understand when working with classes, members should always be kept private and then you should have functions in the public section that manipulates this data. But what if you have a class within a class, for example:

class Player
{
public:
Inventory backpack;
}

--------------------------
Somewhere in the game
---------------------------
{
}


Would it still be considered bad practice if the class that is contained within still has it's members encapsulated?

0

Create an account

Register a new account