Fix return type for lobby functions. MAPS ARE ALREADY POINTERS.

This commit is contained in:
Marco 2023-04-18 22:54:32 +02:00
parent 447ea90230
commit e55187ee11
1 changed files with 5 additions and 5 deletions

View File

@ -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) {