Our Code Style follows a mixture of a modified version of Google's C++ Style Guide a modified version of the Microsoft Coding Standart for naming.
Here are a list of the most notable modifications:
- Public members and types are named using PascalCase.
- Private members (Except functions) are named using camelCase.
- We do NOT use prefixes or suffixes when defining variables.
- The sole exception are for interface types, which should be prefixed with a single uppercase I.
- Example:
ICombatant
- Example:
- The sole exception are for interface types, which should be prefixed with a single uppercase I.
- We use
#pragma once
over define guards. - All primitive integer and floating points variables and members should be defined using the defined types at <Common/Types.h>, for example: uint8, uint32, float32, float64, int32.
- Interface types should also be declared using the interface define, which is defined at <Common/Types>.
#pragma once
#include <Common/Types.h>
class ProjectilePool : public Actor {
private:
// The amount of objects that are allocated when the actor is initialized
uint32 prewarmAmount;
/* The amount of objects that are allowed to be allocated at, when all the polled
* objects are in use.
* If there currently more temporary objects allocated than tempAllocAmount, then ProjectilePool#Get
* will return a nullptr;
*/
uint32 tempAllocAmount;
void Prewarm();
public:
Projectile * Get();
bool IsCompletelyInUse();
bool HasTemporaryAllocations();
uint32 GetTotalInUse();
uint32 GetTotalTemporary();
void Return(Projectile * projectile);
}
interface IControlledEntityChangedListener {
void OnChanged(Entity oldEntity, Entity newEntity);
}