refactor: game funcs moved to controller
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user