Original Post
I am trying to code my game in pure C++ style. But this is what gets me stuck; In C++ is the idea to use class'es. I want(ed) to use my CBitmaps class but it doesn't go because of the/my object definition. I always insist to have definitions as struct's, like this: Structures with no functions, just data members. Therefore I can't use the CBitmaps class. Or if I make definition a class, like this: With vectors and then I can have it in class'es. So I don't know if I should have the object definitions as struct's or if everything in pure C++ shall be classes. When should one use struct's or classes? When should one use std::vector's or dynamic arrays? And one more thing should I have the constructor/function parameters char *pointer, std::string or std::string& reference. How is the most valid C++ coding manner way of doing it? It's things like this which gets me stuck and holds me from getting any results done, please help.
struct sObjectDef
{
sBitmaps *m_pBmps; // dynamic array of bitmap structs.
Uint8 m_nBmps; // the amount of bitmap structs of the above array.
sSequence *m_pSeqs; // dynamic array of sequence structs.
Uint8 m_nSeqs; // the amount of sequence structs of the above array.
};
class CObjectDef
{
public:
CObjectDef(char *nameID);
std::string m_strNameID;
std::vector<CBitmaps *> m_vecBmps;
std::vector<CSequence *> m_vecSeqs;
};