Wip: Working on room movements, player location in room, and data storage

This commit is contained in:
Timothy O'Barr
2026-09-11 16:07:17 -05:00
parent 0e7406db96
commit b9104dad64
13 changed files with 79 additions and 62 deletions
+4 -25
View File
@@ -2,24 +2,17 @@
#include <algorithm>
#include <string>
Player::Player()
{
Init();
}
Player::Player() { Init(); }
Player::Player(Player &rhs)
{
Player::Player(Player &rhs) {
id = rhs.id;
level = rhs.level;
stats = rhs.stats;
name = rhs.name;
description = rhs.description;
curRoomID = rhs.curRoomID;
prevRoomID = rhs.prevRoomID;
}
Player& Player::operator=(Player& rhs)
{
Player &Player::operator=(Player &rhs) {
swap(*this, rhs);
return *this;
}
@@ -42,24 +35,10 @@ void Player::TakeDamage(int damageType, float damage) {
float Player::GetHealth() { return 0.0f; }
void Player::ChangeRoom(int roomID) {
if (prevRoomID == roomID) {
curRoomID = prevRoomID;
}
else if (curRoomID != roomID) {
prevRoomID = curRoomID;
curRoomID = roomID;
}
}
Player::~Player()
{
Player::~Player() {
id = -1;
level = -1;
stats = {};
name.erase();
description.erase();
curRoomID = -1;
prevRoomID = -1;
}