You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
652 B

package room
import (
"math/rand"
"time"
"daydev.org/shipsgs/internal/player"
)
const ()
var Names = map[int]string{
1: "Lisbon",
2: "Porto",
3: "Azores",
4: "Lagos",
5: "Guimaraes",
6: "Algarve",
7: "DouroRiver",
8: "Braga",
}
type Room struct {
Name string `json:"Name"`
//Players
players map[*player.Player]bool
//Room state
}
func (r *Room) PlayerJoin() {
}
func (r *Room) PlayerLeave() {
}
func (r *Room) TextAnnounce() {
}
func (r *Room) Update() {
}
func RandomName() string {
s := rand.NewSource(time.Now().UnixNano())
r := rand.New(s)
i := r.Intn(8) // Hardcoded qty of names for lobbies
return Names[i]
}