-
Notifications
You must be signed in to change notification settings - Fork 0
/
Skill.h
67 lines (62 loc) · 1.61 KB
/
Skill.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#pragma once
#include<string>
#include<vector>
struct SkillRequirement
{
std::string name;
int level;
SkillRequirement(std::string namePrm="", int levelPrm=0) :name(namePrm), level(levelPrm) {}
};
struct StatRequirement
{
std::string name;
int level;
StatRequirement(std::string namePrm = "", int levelPrm = 0) :name(namePrm), level(levelPrm) {}
};
class Skill
{
public:
virtual std::vector<SkillRequirement> GetSkillRequirements() { return std::vector<SkillRequirement>(); };
virtual std::vector<StatRequirement> GetStatRequirements() { return std::vector<StatRequirement>(); };
std::string GetName() { return _name; }
protected:
Skill(std::string name = "", std::string description="", int level = 0) { _name = name; _description=description, _level = level; }
std::string _name;
std::string _description;
int _level;
};
class MathsSkill :public Skill
{
public:
MathsSkill()
{
_name = "Maths";
_description = "Used in everything.";
_level = 0;
}
std::vector<SkillRequirement> GetSkillRequirements() override
{
std::vector<SkillRequirement> result;
return result;
};
std::vector<StatRequirement> GetStatRequirements() override
{
std::vector<StatRequirement> result;
return result;
};
};
class ElectronicsSkill:public Skill
{
std::vector<SkillRequirement> GetSkillRequirements() override
{
std::vector<SkillRequirement> result;
result.push_back(SkillRequirement(MathsSkill().GetName(), 1));
return result;
};
std::vector<StatRequirement> GetStatRequirements() override
{
std::vector<StatRequirement> result;
result.push_back(StatRequirement("Intelligence", 1));
return result;
};
};