Fix return type for lobby functions. MAPS ARE ALREADY POINTERS.
This commit is contained in:
parent
447ea90230
commit
e55187ee11
@ -6,9 +6,9 @@ import (
|
|||||||
|
|
||||||
type Lobby map[uuid.UUID]Player
|
type Lobby map[uuid.UUID]Player
|
||||||
|
|
||||||
var lobbyInstance *Lobby = nil
|
var lobbyInstance Lobby = nil
|
||||||
|
|
||||||
func GetLobby() *Lobby {
|
func GetLobby() Lobby {
|
||||||
if lobbyInstance == nil {
|
if lobbyInstance == nil {
|
||||||
lobbyInstance = newLobby()
|
lobbyInstance = newLobby()
|
||||||
}
|
}
|
||||||
@ -16,9 +16,9 @@ func GetLobby() *Lobby {
|
|||||||
return lobbyInstance
|
return lobbyInstance
|
||||||
}
|
}
|
||||||
|
|
||||||
func newLobby() *Lobby {
|
func newLobby() Lobby {
|
||||||
var lobby Lobby
|
lobby := make(map[uuid.UUID]Player, 0)
|
||||||
return &lobby
|
return lobby
|
||||||
}
|
}
|
||||||
|
|
||||||
func (lobby Lobby) RegisterPlayer(player *Player) {
|
func (lobby Lobby) RegisterPlayer(player *Player) {
|
||||||
|
Loading…
Reference in New Issue
Block a user