40 lines
751 B
Go
40 lines
751 B
Go
package game
|
|
|
|
func CreateGame(id GameIdentifier, name string, races []Race, planets []Planet) Game {
|
|
return Game{
|
|
Id: id,
|
|
Name: name,
|
|
Turn: 0,
|
|
Races: races,
|
|
Planets: planets,
|
|
}
|
|
}
|
|
|
|
func CreateRace(id RaceIdentifier, name string) Race {
|
|
return Race{
|
|
Id: id,
|
|
Name: name,
|
|
Drive: 1.0,
|
|
Weapons: 1.0,
|
|
Shields: 1.0,
|
|
Cargo: 1.0,
|
|
}
|
|
}
|
|
|
|
func CreatePlanet(number uint, name string, position Coordinate, size float64, res float64, pop float64) Planet {
|
|
return Planet{
|
|
Number: number,
|
|
Name: name,
|
|
Position: position,
|
|
Size: size,
|
|
Production: ProductionType{ProductionDrive, ""},
|
|
Resources: res,
|
|
Population: pop,
|
|
|
|
Industry: 0,
|
|
Capital: 0,
|
|
Material: 0,
|
|
Colonists: 0,
|
|
}
|
|
}
|