Attack class - kquinn1/FundComp_pokemon GitHub Wiki

Attack.cpp & Attack.h

Documentation written by: Katie Quinn

Pokemon fight using attacks. Attacks will be implemented using composition.

#Private variables:#

string type: represents the type of attack. e.g. physical.

TODO: research pokemon attack types.

int power: represents the power of an attack.

int pp: represents the number of times the attack can be used.

int accuracy: represents the accuracy of the attack. (Should this be an integer?)

#Public member functions:#

Attack(string, int, int, int): constructor

int getPower(): returns the power of an attack.

int getPP(): returns the PP or the number of times an attack can be used

string getType(): returns the type of an attack.

int getAcc(): returns the accuracy of an attack.

void updatePP(): updates the number of times an attack can be used. When the attack is used, the PP should be decreased by 1. Should not be able to use the attack if PP is 0.