⚙️ method Config.GetUnitConfig(...)
Last updated:4/16/2026
URL
https://github.com/42core-team/monorepo/blob/dev/bots/go/client_lib/game/config.go
Description
Get the unit config for a specific unit type.
Signature
func (c *Config) GetUnitConfig(unitType UnitType) *UnitConfigParameters
unitType UnitType: The type of unit to get the config for
Return
*UnitConfig: The unit config or nil if no such unit type exists.
Examples
uconf := g.Config.GetUnitConfig(game.UnitMiner)
myCore := g.MyCore()
if myCore != nil && uconf != nil {
coreData := myCore.GetCoreData()
if coreData != nil && coreData.Gems >= uconf.Cost {
b.CreateUnit(game.UnitMiner)
}
}