game generation process

This commit is contained in:
Ilia Denisov
2025-09-25 02:13:16 +03:00
parent 99035fd95d
commit 46066d890b
12 changed files with 206 additions and 101 deletions
+1 -1
View File
@@ -22,7 +22,7 @@ func Generate(cfg ...func(*MapSetting)) (Map, error) {
freePlanets := ms.NobodysPlanets()
createPlanets := func(pc PlanetClass, ps PlanetSetting) error {
return m.CreatePlanets(pc, rand.Intn(ps.MaxCount(freePlanets))+1, float64(ps.MinDistanceHW), RandIFn(ps.MinSize, ps.MaxSize), RandIFn(ps.MinResource, ps.MaxResource))
return m.CreatePlanets(pc, ps.Number(freePlanets), float64(ps.MinDistanceHW), RandIFn(ps.MinSize, ps.MaxSize), RandIFn(ps.MinResource, ps.MaxResource))
}
// 1. Place Giant planets