Wip: Working on room movements, player location in room, and data storage
This commit is contained in:
+4
-25
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user