refactor: game funcs moved to controller

This commit is contained in:
Ilia Denisov
2026-01-15 14:42:04 +02:00
parent fe8a8d4150
commit 16aba8435d
47 changed files with 1023 additions and 3093 deletions
+2 -13
View File
@@ -115,17 +115,6 @@ func (c *Cache) UpdateRelation(ri, other int, rel game.Relation) (err error) {
err = e.NewGameStateError("UpdateRelation: opponent not found")
}
return
// for o := range c.g.Race[r1].Relations {
// if c.g.Race[r1].Relations[o].RaceID == c.g.Race[r2].ID {
// c.g.Race[r1].Relations[o].Relation = rel
// if c.cacheRelation != nil {
// c.updateRelationCache(r1, r2, rel)
// }
// return nil
// }
// }
// return e.NewGameStateError("UpdateRelation: opponent not found")
}
func (c *Cache) validateRaceIndex(i int) {
@@ -142,7 +131,7 @@ func (c *Cache) raceIndex(name string) (int, error) {
return i, nil
}
func (c *Cache) racetTechLevel(ri int, t game.Tech, v float64) {
c.validateFleetIndex(ri)
func (c *Cache) raceTechLevel(ri int, t game.Tech, v float64) {
c.validateRaceIndex(ri)
c.g.Race[ri].Tech = c.g.Race[ri].Tech.Set(t, v)
}