Variables

read onlybuildingId:Null<BuildingKind>

The kind of building affected by this bonus, if applicable. Example : Free upgrade for the Training Camp.

read onlyid:BonusKind

The bonus identifier.

read onlyisAdvanced:Bool

Is the bonus an advanced one, with improved values.

read onlyresId:Null<BuildingKind>

The kind of resource affected by this bonus, if applicable. Example : +2 Wood.

read onlyunitId:Null<UnitKind>

The kind of unit affected by this bonus, if applicable. Example : Skirmisher's attack power.

Methods

getDesc(?player:Player):String

Get the formatted description of the bonus, with the right value and relative unit, building or resource when its the case.

Parameters:

player

Returns:

String

getIVal(?id:BonusValId):Int

Same as getVal but returns an integer value

Parameters:

id

Returns:

Int

getVal(?id:BonusValId):Float

Return the value of the current bonus, depending on whether it's an advanced one

Parameters:

id

Returns:

Float