Merge branch 'paul' into AL/races-potions

This commit is contained in:
a25liang
2024-07-13 16:04:17 -04:00
34 changed files with 1221 additions and 359 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,37 @@ 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;
}
void potion::print(display *out, bool color) {
out->print_char(pos, 'P');
}