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

View File

@ -6,9 +6,9 @@ import (
type Lobby map[uuid.UUID]Player
var lobbyInstance *Lobby = nil
var lobbyInstance Lobby = nil
func GetLobby() *Lobby {
func GetLobby() Lobby {
if lobbyInstance == nil {
lobbyInstance = newLobby()
}
@ -16,9 +16,9 @@ func GetLobby() *Lobby {
return lobbyInstance
}
func newLobby() *Lobby {
var lobby Lobby
return &lobby
func newLobby() Lobby {
lobby := make(map[uuid.UUID]Player, 0)
return lobby
}
func (lobby Lobby) RegisterPlayer(player *Player) {