Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/extensions/copilot/src/extension/prompts/node/test/fixtures/cppNoExtraSemicolons.summarized.cpp
13406 views
1
class Item {
2
private:
3
std::string name;
4
std::string description;
5
int value;
6
7
public:
8
9
};
10
11
/**
12
* Weapon class derived from Item
13
*/
14
class Weapon : public Item {
15
private:
16
int damage;
17
18
public:
19
Weapon(const std::string& name, const std::string& desc, int value, int weaponDamage)
20
: Item(name, desc, value), damage(weaponDamage) {}
21
22
int getDamage() const {}
23
24
void use() override {}
25
};
26
27
/**
28
* Character class for player and NPCs
29
*/
30
class Character {
31
private:
32
std::string name;
33
int health;
34
int maxHealth;
35
std::vector<std::shared_ptr<Item>> inventory;
36
std::shared_ptr<Weapon> equippedWeapon;
37
38
public:
39
40
};
41
42
43