Will edit this and give valuable feedback when I'm not so tired
Thanks, I have pretty much created this entire program looking at all of my old coding projects, and the way i tried to do it was how i thought i did it last time.
I want to do something similar to the following examples, without making all the global this time.
The following are examples from multiple files from another game. Deleted unimportant stuff to save space.
class Monster // Defines the existance of monsters
{ string Type;
int Atk;
int Def;
int HP;
int SpAtk;
int SpDef;
string Advantage;
string Disadvantage;
string MonsterName;
int Speed;
int Level;
int Experience;
Moves move;
Moves move1;
Moves move2;
Moves move3;
Moves move4;
public:
Monster();
~Monster();
//... was more code
void FireType(); //The Fire Type
};
I'll just create a new post instead.
I think before you fix your errors/bugs, take some time to learn more about
inheritance and polymorphism.
Also, I'm a generally tired person, so my help might be in vain.
Just to back up my suggestion, however, here's a sloppy example I slapped together of what your classes could possibly look like :
#ifndef _MOB_H_
#define _MOB_H_
//I know, I know, don't gimme yo attitude.
#include <string>
#include <vector>
class Attribute {
public :
Attribute() {/*code*/}
/*
Whatever you want attributes to be. Either skills (strength, endurance, magicka, etc.)
or maybe modifiers of some kind (fire resistance, etc.)
*/
//methods and stuff goes here.
};
class Equipment {
public :
Equipment() {}
std::string name;
int health;//quality or condition of equipment.
int mod;//this is me not being smart. Could be used for different purposes depending on if it's a weapon or armor, etc.
//other things for base class
};
class Weapon : public Equipment {
public :
Weapon() {}
//implicitly call base constructor if you need to.
//weapon unique code here
};
class Armor : public Equipment {
public :
Armor() {}
//same deal
};
//class Move {
//too lazy forgive me
class Mob {
public:
Mob() {}
std::string name;
std::vector<Attribute> attributes;
std::vector<Equipment> equipment;
std::vector<Move> moves;
//methods which iterate through each vector respectively and do things
};
#endif