@ -46,6 +46,10 @@ int getCharacterLevel (Character *character) {
return character->level;
}
int calculateStatIncrease (Character *character, int amount) {
return character->level*amount;
void increaseStat (Character *character, int stat, int amount) {
switch (stat)
@ -31,4 +31,6 @@ void setCharacterLevel (Character *character, int newLevel);
int getCharacterLevel (Character *character);
void increaseStat (Character *character, int stat, int amount);
int calculateStatIncrease (Character *character, int amount);
#endif
@ -80,4 +80,8 @@ void test_increaseStat(void) {
TEST_ASSERT_EQUAL_INT(22,testCharacter2.intelligence);
void test_calculateStatIncrease(void) {
TEST_ASSERT_EQUAL_INT(5,testCharacter2.level);
TEST_ASSERT_EQUAL_INT(25,calculateStatIncrease(&testCharacter2,5));
#endif // TEST