Пример #1
0
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)),
	})
}
Пример #2
0
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)),
	})

}
Пример #3
0
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

}