-
Notifications
You must be signed in to change notification settings - Fork 1
Developer guide
Lauri Mäkinen edited this page Oct 7, 2013
·
19 revisions
Current main compiler is clang on Linux, vs2012 on Windows. Others may or may not work.
First you need to compile the termbox and install it. You can look at the .travis.yml file for commands.
Makefile building is managed with premake4. (Ubuntu repositories have the old version that doesn't work)
premake4 gmake
make
./test
./ice
On windows the premake4 is also used. Prefered toolset on Windows is Visual studio.
premake4 vs2010
//open vs and compile
On windows you also need to have SFML and Boost libraries.
TODO: tell me more about sfml and boost
The rules and regulations have not been defined yet, however that's no excuse to not try to maintain a clean, consistent, and maintainable codebase. As the project develops bigger true standards will be fixed and put into place.
Use tabs! Do not use spaces!
// Class names always begin with a capital letter
// Words that follow have their first letter capitalized
class ClassExampleName {};
// Variables and functions begin with a lower case letter
// Words that follow have their first letter capitalized
int variableExampleName = 0;
void functionExampleName() {}//Header guards follow the folder path (/engine/actor/player/PlayerActor.h)
#ifndef ENGINE_ACTOR_PLAYER_PLAYERACTOR_H
#define ENGINE_ACTOR_PLAYER_PLAYERACTOR_H
#include "engine/actor/ActorBase.h"
#include "engine/input/InputMapping.h"
//Namespaces always on the same line
namespace game {
namespace actor {
namespace player {
/**
* inline documentation goes on top of the class/function
*/
class PlayerActor : public engine::actor::ActorBase {
private:
int someVariable = 3;
public:
void someFunction();
};
}
} /* namespaces */
}// functionName() is responsible for doingStuff (literally)
void ClassName::functionName() {
// do stuff!
doStuff();
}if(something) {
doSomething();
}
//Also remember to add nice spacing to for loops
for(int i=0; i<10; i++) {
doSomething(i);
}
while(true) {
doSomething();
}int var1Something = 213;
int var2SomeVal = 123 + var1Something;
int anotherVar = 123;// Don't do this
// The small compressed name makes it difficult to read and can
// give the impression that it's more complex than it really is.
double wpnDmgMltplr;
// Do this
// It's clear to the other developer that this variable is meant to be
// used to multiply the damage of something.
double weaponDamageMulti;