1
This commit is contained in:
parent
6095167478
commit
e7c340d53a
@ -22,3 +22,9 @@ void RoomOb::UnInit()
|
|||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Player* RoomOb::GetByAccountId(const std::string& account_id)
|
||||||
|
{
|
||||||
|
auto itr = id_hash_.find(account_id);
|
||||||
|
return itr != id_hash_.end() ? itr->second : nullptr;
|
||||||
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
class Room;
|
class Room;
|
||||||
|
class Player;
|
||||||
|
|
||||||
class RoomOb : public std::enable_shared_from_this<RoomOb>
|
class RoomOb : public std::enable_shared_from_this<RoomOb>
|
||||||
{
|
{
|
||||||
@ -11,7 +12,9 @@ class RoomOb : public std::enable_shared_from_this<RoomOb>
|
|||||||
void Init();
|
void Init();
|
||||||
void UnInit();
|
void UnInit();
|
||||||
|
|
||||||
|
Player* GetByAccountId(const std::string& account_id);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Room* room_ = nullptr;
|
Room* room_ = nullptr;
|
||||||
|
std::map<std::string, Player*> id_hash_;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user