NOTE: Plane refers to any numbered plane or vehicle in the set
Here is what I understand:
the first number is the plane followed by a comma and then one character for each field in the terrain.
N is no chess piece has the plane at that field, Y is all chess pieces have the plane at that field. 0 (Zero) is Bishops have the plane at that field. 1 is Knights have the plane at that field. 2 is Rooks have the plane at that field.
There are some missing pieces. Three pieces to be exact. What are the numbers for the following combinations ?: Bishops and Knights have the plane at the field, Bishops and Rooks have the plane at that field and Knights and Rooks have the plane at the field.
Not quite...what actually is happening from the program perspective is that their is a bitwise enumerated variable that holds a value, and the variable is more than likely defined thusly:
[FLAG ATTRIBUTE]
enum BitwiseFieldFlag
{
Undefined = 0, //0000
Bishop = 1, //0010
Knight = 2, //0100
Rook = 4 //1000
}
If you look at the following lines for the P51D for field A1 (mindan09.pln) it should become apparent rather rapidly what is going on..
When an aircraft is unrestricted by country, meaning it is either available for all, or disabled for all, the program omits the NUMERIC second character in the csv line and rightfully simply looks at Y or N for each corresponding field in the string. Of course the program reading this file is doing an "Is Numeric Function Call" check on that second character while parsing that text line...
However when an aircraft has a country restrictions, the second character is a numeric character...the program sees this and converts the text to an integer value and assigns the value to the bitwise variable. its a tad more complicated than that but suffice to say that explanation should do for now...
In the case of our example, the integer equivalent values that can be represented by our bitwise flag variable are : 0, 1, 2, 3, 4, 5, 6 and 7
Based on this it is simple to see that
0 = Undefined
1 = Only Bishop Selected
2 = Only Knight Selected
3 = Bishop + Knight Selected ( 1 + 2 )
4 = Only Rook Selected
5 = Bishop + Rook Selected ( 1 + 4 )
6 = Knight + Rook Selected ( 2 + 4 )
7 = Not Used > Falls back to Undefined
So when you set a field for Bishop and Knight, you are telling the program that the bitwise variable would go something like this:
BitWiseFieldFlag myFieldFlag = BitWiseFieldFlag.Bishop AND BitwiseFieldFlag.Knight
The program variable now equals both Bishop and Knight and the program prints a 3 as the second character of the line for that aircraft as a string representation of an integer value (actually its bitwise 0011 ...)
Oneway
EXAMPLE .PLN FILE OUT PUT ALL VARIABLE CHOICES FOR MINDAN09, P51, FIELD A1P51D Field A1 (index 0) mindan09Disabled for all countries:
0,NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
Enabled for Bishops (country 1, index 0):
0,1NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
Enabled for Knights (country 2, index 1):
0,2NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
Enabled for Rooks (country 3, index 2):
0,4NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
Enabled for Bishops & Knights:
0,3NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
Enabled for Knights & Rooks:
0,6NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
Enabled for Bishops and Rooks
0,5NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
Enabled for All Countries:
0,YNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN