cmd: join ship groups

This commit is contained in:
Ilia Denisov
2025-11-13 21:53:10 +03:00
parent 33efa86065
commit 126f381b04
10 changed files with 661 additions and 153 deletions
+4 -4
View File
@@ -65,7 +65,7 @@ func buildGameOnMap(races []string, m generator.Map) (*game.Game, error) {
Shields: 1,
Cargo: 1,
}
gameMap.Planet = append(gameMap.Planet, newPlanet(
gameMap.Planet = append(gameMap.Planet, NewPlanet(
planetCount,
m.HomePlanets[i].HW.RandomName(),
raceID,
@@ -79,7 +79,7 @@ func buildGameOnMap(races []string, m generator.Map) (*game.Game, error) {
))
planetCount++
for dw := range m.HomePlanets[i].DW {
gameMap.Planet = append(gameMap.Planet, newPlanet(
gameMap.Planet = append(gameMap.Planet, NewPlanet(
planetCount,
m.HomePlanets[i].DW[dw].RandomName(),
raceID,
@@ -101,7 +101,7 @@ func buildGameOnMap(races []string, m generator.Map) (*game.Game, error) {
}
for i := range m.FreePlanets {
gameMap.Planet = append(gameMap.Planet, newPlanet(
gameMap.Planet = append(gameMap.Planet, NewPlanet(
planetCount,
m.FreePlanets[i].RandomName(),
uuid.Nil,
@@ -125,7 +125,7 @@ func buildGameOnMap(races []string, m generator.Map) (*game.Game, error) {
return g, nil
}
func newPlanet(num uint, name string, owner uuid.UUID, x, y, size, pop, ind, res float64, prod game.ProductionType) game.Planet {
func NewPlanet(num uint, name string, owner uuid.UUID, x, y, size, pop, ind, res float64, prod game.ProductionType) game.Planet {
return game.Planet{
Owner: owner,
PlanetReport: game.PlanetReport{