You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WireWhiz edited this page Jun 28, 2022
·
3 revisions
This document is currently in progress, and will be added to as needed
File naming and structure
All code files go in the src directory, organized based on what build targets rely on them. If they only apply to one target they go in the folder named after said target. Otherwise, they go in the common folder. Most of the time the source files will also be grouped into folders based on what they do. For example, most core networking-related code goes in src/common/networking.
File names should match the class that is contained in them or the name of the most prominent class. Directory and file names should follow Camel Case, even though this will usually not match the capitalization of the class.
Classes
I currently haven't standardized the way I do the layout of classes. Usually, I just put private, protected, and then public members; all grouped by variables and then functions.
Private and protected variables are prefixed with an underscore: T _privateVariable
Brackets
if(...)
{
}
while(...)
{
}
switch(...)
{
case ...:
return;
case ...:
...
break;
case ...:
{
...
break;
}
}
Everything else
Just make it look nice, I'll add stuff here as I run into it.