changes to characters and potions, work in progress

This commit is contained in:
2024-07-13 00:59:52 -04:00
parent afc2b9fa12
commit f2d2f6f72d
22 changed files with 215 additions and 76 deletions

View File

@ -1,7 +1,7 @@
#include "potion.h"
potion::potion(const potion_type type, const int duration):
type{type}, remaining_duration{duration} {}
potion::potion(const potion_type type, const int duration, const position &pos):
type{type}, remaining_duration{duration}, pos{pos} {}
potion_type potion::get_type() const {
return type;
@ -10,3 +10,33 @@ potion_type potion::get_type() const {
int potion::get_duration() const {
return remaining_duration;
}
position potion::get_pos() const {
return pos;
}
void potion::set_pos(const position &npos) {
pos = npos;
}
potion::potion(const potion &p):
type(p.type), remaining_duration(p.remaining_duration),
pos{p.pos} {}
potion::potion(potion &&p):
type(p.type), remaining_duration(p.remaining_duration),
pos{p.pos} {}
potion &potion::operator=(const potion &p) {
type = p.type;
remaining_duration = p.remaining_duration;
pos = p.pos;
return *this;
}
potion &potion::operator=(potion &&p) {
type = p.type;
remaining_duration = p.remaining_duration;
pos = p.pos;
return *this;
}