Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Poojith-Patnala-s-Contribution/PocketMonsterClass
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
28 lines (25 sloc)
920 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*Basic code on Pocket Monsters class by Poojith Patnala. */ | |
class Pocket_Monsters { | |
char* type; | |
char* weakness; | |
int level; | |
int xp; | |
float baseStats[3]; //attack health and defence //array is kind of a pointer | |
float actualStats[3]; //a formula calculating actualstats by multiplying base stats by levels | |
float bonuses[3]; // extra bonuses for the attack, health and defence, from bonuses like potions. | |
int numberOfBattles; // number | |
bool isDowned; //pokemon is down until it wont be down anymore | |
public: | |
Pocket_Monsters() { | |
type = NULL; // NUll means nothing, null pointer// best practice for using NULL | |
weakness = NULL; | |
level = NULL; | |
xp = NULL; | |
baseStats[]=nullptr; //Null pointer means nothing for pointer instead normal variable | |
actualStats[]=nullptr; | |
bonuses[]=nullptr; // | |
numberOfBattles = NULL; | |
isDowned = false; | |
} | |
void isXpEnoughForLvlUp() { | |
} |