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
|
||||
|
||||
class Room;
|
||||
class Player;
|
||||
|
||||
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 UnInit();
|
||||
|
||||
Player* GetByAccountId(const std::string& account_id);
|
||||
|
||||
private:
|
||||
Room* room_ = nullptr;
|
||||
|
||||
std::map<std::string, Player*> id_hash_;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user