Boolean Values must be either a 0 or 1. They are utilized for Logic Checks and bear little flexibility. For numerous functions it is preferable to utilize an Integer value instead and design the Translation Code to utilize it as a percentage. Then 100 and 0 become equivalent to 1 and 0 (respectively). In cases where something is very cut and dry a yes/no decision, Booleans are ideal for their speed of processing.

The default value for any Boolean will be 0, so omission of the field will result in an assumed 0. The XML Filestructure will not allow any values besides 0 or 1 due to the Schema declaration that it should expect a Boolean. However, if the Schema is altered to allow a different value type, the code from there in would readily accept any value.

Naming conventions dictate that any Boolean values start with the letter "b" to indicate their data type in the XML. Once the XML had been loaded into the main code, this indicator is dropped.

 For example: <bRace>

Typical fields to utilize the information found in a Float variable are "is___" "getCount___" "changeCount___" "set___"

 For example: .isRace(), .changeCountRace(1), .getCountRace() & .setRace()

The reason for the "Count" functions is so that multiple cases of a Boolean can be utilized. This only matters in situations where multiple sources of the Boolean can exist for a single data set, and the cases will change over time; like Promotion information being loaded onto a Unit, or Building Information being loaded onto a Player or City. In these cases, you might have multiple cases of the Boolean being set to 1, and without a count of how many exist, the Boolean would need re-checked each time that one case was removed to verify if the control Boolean (that for the Unit, City or Player) ought to be disabled as well.

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.