generated from schreifuchs/wails-template
status after 3h & 30min
This commit is contained in:
@ -12,19 +12,18 @@ type Game struct {
|
||||
type Participant struct {
|
||||
gorm.Model
|
||||
Name string
|
||||
IsTemporary bool // only for one tournament
|
||||
IsTemporary bool `json:"Size,string,omitempty"` // only for one tournament
|
||||
IsTeam bool
|
||||
Tournaments []*Tournament `gorm:"many2many:partcipant_tournaments;"`
|
||||
}
|
||||
|
||||
type Tournament struct {
|
||||
gorm.Model
|
||||
Title string
|
||||
GameID int
|
||||
Game Game `gorm:"foreignKey:GameID"`
|
||||
Size int `json:"Size,string,omitempty"` // number of prarticipants
|
||||
TournamentState int
|
||||
|
||||
Title string
|
||||
GameID int
|
||||
Game Game `gorm:"foreignKey:GameID"`
|
||||
Size int // number of prarticipants
|
||||
TournamentState int
|
||||
WinnierParticipantID int
|
||||
WinnierParticipant Participant `gorm:"foreignKey:WinnierParticipantID"`
|
||||
Participants []*Participant `gorm:"many2many:partcipant_tournaments;"`
|
||||
|
65
model/names.go
Normal file
65
model/names.go
Normal file
@ -0,0 +1,65 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"crypto/rand"
|
||||
"math/big"
|
||||
)
|
||||
|
||||
var funnyNames = []string{
|
||||
"Captain Quirk",
|
||||
"Giggle Muffin",
|
||||
"Bubbles McFarty",
|
||||
"Dapper Dingle",
|
||||
"Wacky McWiggles",
|
||||
"Sir Laughs-a-Lot",
|
||||
"Chuckles the Chipmunk",
|
||||
"Fuzzy Pickles",
|
||||
"Snickerdoodle Sprout",
|
||||
"Zany Zucchini",
|
||||
"Professor Pudding",
|
||||
"Bumbling Bumblebee",
|
||||
"Cheeky Monkey",
|
||||
"Silly Sausage",
|
||||
"Wobble Bottom",
|
||||
"Grinning Goblin",
|
||||
"Fluffy Fiasco",
|
||||
"Tickle Tortilla",
|
||||
"Jolly Jester",
|
||||
"Merry Marmalade",
|
||||
"Wacky Wonka",
|
||||
"Noodle Nugget",
|
||||
"Bubblegum Bandit",
|
||||
"Funky Ferret",
|
||||
"Giggle Gopher",
|
||||
"Happy Hiccup",
|
||||
"Nifty Noodle",
|
||||
"Dizzy Donut",
|
||||
"Bouncy Biscuit",
|
||||
"Frolic Fox",
|
||||
"Whimsical Wombat",
|
||||
"Peppy Pumpernickel",
|
||||
"Loco Lobster",
|
||||
"Sassy Sasquatch",
|
||||
"Rambunctious Radish",
|
||||
"Prankster Panda",
|
||||
"Zippy Zebra",
|
||||
"Giggling Giraffe",
|
||||
"Funky Flamingo",
|
||||
"Silly Sphinx",
|
||||
"Guffawing Gopher",
|
||||
"Cheerful Cucumber",
|
||||
"Hapless Hedgehog",
|
||||
"Jovial Jalapeño",
|
||||
"Bubbly Banana",
|
||||
"Quirky Quokka",
|
||||
"Dandy Dodo",
|
||||
"Laughing Llama",
|
||||
"Zany Zephyr",
|
||||
}
|
||||
|
||||
func RandomName() string {
|
||||
x := big.NewInt(int64(len(funnyNames) - 1))
|
||||
i, _ := rand.Int(rand.Reader, x)
|
||||
|
||||
return funnyNames[i.Int64()]
|
||||
}
|
Reference in New Issue
Block a user