desocupado
Magister
- Joined
- Nov 17, 2008
- Messages
- 1,802
C++
I have three files, Base_Equip, Base_Weapon and Base_Armor. I'm trying to make Base_Weapon and Base_Armor inherit from Base_Equip, but I always get the fucking "Base class undefined" message. I managed to get one working, but not the other. Now, none are working. At some point, just putting an include to Base_Equip on them broke the program, without even trying to make them inherit shit. I looked at the order of the includes elsewhere and tried to put "#include "Base_Equip.h"" first on the order in the other files. But it didn't work.
I'm at a loss here.
Here's Base_Equip, Base_Armor and Base_Weapon. The way they're listed here, with the inheritance and "#include "Base_Equip" commented, the program runs. If I just uncomment the "#include "Base_Equip" thing, something else breaks, like Dummy_Weapon, which inherits from Base_Weapon, starts complaining about "Base class undefined". Besides those files, the project has around 20 other files, so I can't paste all here. If any of you want it, ask me, and I'll upload it somewhere.
I have three files, Base_Equip, Base_Weapon and Base_Armor. I'm trying to make Base_Weapon and Base_Armor inherit from Base_Equip, but I always get the fucking "Base class undefined" message. I managed to get one working, but not the other. Now, none are working. At some point, just putting an include to Base_Equip on them broke the program, without even trying to make them inherit shit. I looked at the order of the includes elsewhere and tried to put "#include "Base_Equip.h"" first on the order in the other files. But it didn't work.
I'm at a loss here.
Here's Base_Equip, Base_Armor and Base_Weapon. The way they're listed here, with the inheritance and "#include "Base_Equip" commented, the program runs. If I just uncomment the "#include "Base_Equip" thing, something else breaks, like Dummy_Weapon, which inherits from Base_Weapon, starts complaining about "Base class undefined". Besides those files, the project has around 20 other files, so I can't paste all here. If any of you want it, ask me, and I'll upload it somewhere.
#pragma once
#include <vector>
#include "Skill.h"
class Base_Equip
{
public:
Base_Equip();
virtual ~Base_Equip()
{
}
protected:
//std::vector<Skill*> Equip_Skills;
//enum_Equip_Type Type;
//std::string string_name;
};
#pragma once
#include "SDL.h"
#include "struct.h"
#include "Base_Equip.h"
class Base_Armor //: public Base_Equip
{
public:
Base_Armor()
{
}
virtual ~Base_Armor()
{
}
struct_armor Return_Stats()
{
return armor_stats;
}
protected:
struct_armor armor_stats;
std::vector<Skill*> Equip_Skills;
enum_Equip_Type Type;
std::string string_name;
};
#pragma once
#include "struct.h"
#include <vector>
//#include "Base_Equip.h"
class Base_Weapon //: public Base_Equip
{
public:
Base_Weapon();
virtual ~Base_Weapon()
{
}
virtual struct_buff Attack();
int Return_Range();
protected:
int int_damage_type;
int int_accuracy;
int int_min_damage;
int int_max_damage;
int int_crit_chance;
int int_kill_chance;
int int_range;
int int_attack_speed;
int int_pen_chance;
int int_number_of_hands;
};