A Mapped Integer is a mapping between a text display value and an integer value. It provides a way for a user to edit an integer property by seeing a drop-down list of text values, hiding the numerical values from them. This provides a means of generating drop-down boxes for entering values where there is a fixed set of valid values that can be entered, while storing an integer in the database.

 

Here is an example of a Mapped Integer defined in the database:

 

exp_bakeryMappedInt

 

To add new values press the Edit button and then the Add button, the new entry will appear at the bottom, set the text string to be viewed and the number to store it as. Then press Save.

 

exp_bakeryMappedEdit

 

There can be as many Mapped Integers as needed in the database. Once the Mapped Integer is created, to use it, create an integer property on a BiskitDef and set its Integer Type to be Mapped Integer and chose the Mapped Integer you have created. Use the Display Group to bring related items together in the same group to make finding them easier.

 

exp_bakeryMappedIntCreate

 

The database stores the values as integers. The definition of the Mapped Integer in the Bakery just maps those numbers to a string for display. At a later date new items can be added to the mapping (new strings and new  integers), the mapping can be changed by changing the text associated with a  particular integer, then everything in the database that has that integer value will be displayed with the new string.

 

If there is a mapping where 1 displays as "A", and 2 displays as "B", and then this mapping is changed so that 2 displays as B and 3 displays as A, and there is no mapping for 1, then there won't be a way to display a text value for 1, and there won't be a way to search for it.