@@ -13,16 +13,18 @@ The first one is related to creating a human, the other five are about handling
13
13
14
14
## 1. Bring humans to the world of Troy
15
15
16
- For your model of Troy humans are the most important feature.
16
+ For your model of Troy, humans are the most important feature.
17
17
Your model human should be able to possess a _ unique artifact_ .
18
18
They should also have the ability to manifest a _ power_ .
19
19
These powers might affect other humans, so you also want to model if a human is influenced by some other power.
20
20
21
21
You are provided with basic implementations of ` artifact ` and ` power ` structs.
22
- Implement a ` human ` struct (or class) that has a _ smart-pointer_ to an ` artifact ` as ` possession ` member variable .
22
+ Implement a ` human ` struct (or class) that has a _ smart-pointer_ to an ` artifact ` member variable named ` possession ` .
23
23
Each artifact can only be possessed by a single human at any given time.
24
24
25
- The ` human ` should also have variables for their ` own_power ` and ` influenced_by ` , which should be _ smart-pointers_ to ` powers ` .
25
+ A ` human ` must have two additional member variables.
26
+ One holds their ` own_power ` and the other is a power they are ` influenced_by ` .
27
+ Both ` own_power ` and ` influenced_by ` are _ smart-pointers_ to ` powers ` .
26
28
Each ` power ` might be owned by a single human, but also influence other humans at the same time.
27
29
28
30
By default, humans are born without any artifact and neither own any powers nor are they influenced by them.
@@ -42,7 +44,7 @@ mindy_mccready.influenced_by;
42
44
Your model is boring without the interaction of its parts.
43
45
You want to create unique artifacts and give them to certain humans.
44
46
45
- Define the function ` give_new_artifact ` which returns nothing but takes a ` human ` and a ` string ` .
47
+ Define the function ` give_new_artifact ` which returns nothing but takes a reference to a ` human ` and a ` string ` .
46
48
With the ` string ` it should define a new ` artifact ` object and set the ` possession ` pointer of the ` human ` accordingly.
47
49
The function should not return anything.
48
50
@@ -80,10 +82,10 @@ uzumaki.possession->name;
80
82
81
83
## 4. Give Power to the People
82
84
83
- The most exiting feature of Troy are the special powers, that people might wield.
85
+ The most exciting feature of Troy are the special powers that people might wield.
84
86
Some can smelt iron with their thoughts, while others can heal every wound instantly at nighttime.
85
87
86
- Define the function ` manifest_power ` which returns nothing but takes a ` human ` and a ` string ` .
88
+ Define the function ` manifest_power ` which returns nothing but takes a reference to a ` human ` and a ` string ` .
87
89
With the ` string ` it should define a new ` power ` object and set the ` own_power ` pointer of the ` human ` accordingly.
88
90
The function should not return anything.
89
91
@@ -100,10 +102,12 @@ eleven.own_power->effect;
100
102
What use are the greatest powers, if you cannot use them.
101
103
Your model concentrates on humans, so you want to track the influence of powers.
102
104
103
- Write a _void_ function `use_power` that takes two humans, first: a caster and secondly: a target.
105
+ Write a _void_ function `use_power` that takes two references to humans.
106
+ The first human is the caster and the second represents the target.
104
107
The target's `influenced_by` pointer should be pointed to the power of the caster.
105
108
106
- For simplicity, humans can only be influenced by a single power and this power stays in place even if the caster does not exist any longer.
109
+ For simplicity, humans can only be influenced by a single power.
110
+ This power stays in place even if the caster does not exist any longer.
107
111
108
112
```cpp
109
113
human pamela_isley{};
0 commit comments