Game Development Reference
In-Depth Information
GUESS_RANDOM,
GUESS_SEMI,
} GUESS_TYPE;
typedef unsigned short USHORT; // for simplicity of declaration
struct sGUESSER_BUCKET
{
USHORT Width; // the actual width of the bucket
USHORT Edge; // the calculated edge of the bucket
GUESS_TYPE GuessType; // the guess type this bucket represents
};
Once we have defined our bucket structures, we create a vector of them:
typedef std::vector< sGUESSER_BUCKET > GUESS_TYPE_LIST;
GUESS_TYPE_LIST mvGuessTypeList;
NAMING CONVENTIONS
Now that the programming part of this topic is starting to get more involved, perhaps
it is a good time to reiterate some of the naming conventions that I use in my code.
Type and struct names are in all caps: MY_TYPE
Struct names are preceded by a lowercase “s�: sMY_STRUCT .
Variables and functions are in initial caps: MyFunction( MyVariable )
Member variables of a class are generally preceded with a lowercase “m�:
mMyMemberVariable
List and vector names are preceded by a lowercase “l� and “v,� respectively.
I combine these when necessary such as in a member of a class that is
also a vector. In this case the name is preceded by “mv� such as in
mvMyMemberVector .
 
Search WWH ::




Custom Search