# How to link functions to upgrade types

The most important property of an Upgrade Type is the defined function pairs. These define which functions are eligible for an upgrade, and to which function they are upgraded. Function pairs consist of 2 functions: a starting function and a target function. the left function in the list is the starting function. The right function in the list is the target function.

It is important to note that, for a given Upgrade Type, each pair must have a unique starting function. It is not possible to have the same function appear as the starting function for multiple pairs in the same Upgrade Type. The target function does not have this restriction.

When a user wishes to upgrade a building, the building's function must be the starting function of a function pair defined for the upgrade. The resulting function will be the target function of the same function pair. It is possible to have the target function be the same as the starting function of the same pair, or of another pair, allowing for consecutive or cyclic upgrades.

#### Adding a function pair

*To add a function pair, select "Add Pair". A new pair will be added to the list. You will notice that as you add more pairs in succession, their functions will be different. This is because of the restriction that the starting function must be different for each pair.*

#### Duplicating a function pair

- To duplicate a function pair, select an existing function pair, and select "Duplicate pair". This will create a new pair, in which the target function is the same as the duplicated pair, and
*the starting function still needs to be defined.*

#### Removing a function pair

*To remove a function pair, select an existing function pair, and select "Remove Pair". This will remove the selected function pair.*

#### Editing a function pair

*To change a function in a function pair, you can either select the function you wish to change from the list of function pairs, and select "Edit Pair", or you can click the image of the function you wish to change. In both cases, the function selection dialog will appear.*