func (t TreatorEnergyStation) TurnOn(b *model_building.Fields, p *model_live_planet.Fields) { levelInfo := GetBuildingLevelInfo(b.Type, b.Level) p.Update(model2.Fields{ "Energy": p.Energy + float64(levelInfo["energyProduced"].(int)), "EnergyAvail": p.EnergyAvail + float64(levelInfo["energyProduced"].(int)), }) }
func (w *Worker) MT_BuildProc(planet *model_live_planet.Fields, m *WorkerMessage) { planet.Update(model2.Fields{ "QueueBuildType": append(planet.QueueBuildType, m.Params["type"].(string)), "QueueBuildX": append(planet.QueueBuildX, m.Params["x"].(int)), "QueueBuildY": append(planet.QueueBuildY, m.Params["y"].(int)), }) }
func (t TreatorMineralMine) TreatSecond(b *model_building.Fields, p *model_live_planet.Fields, th *TreatHint) { levelInfo := GetBuildingLevelInfo(b.Type, b.Level) p.Update(model2.Fields{ "Minerals": p.Minerals + levelInfo["mineralsInSec"].(float64), }) th.UpdateResource = true }