5.7. Chiefs section¶
Note
ChiefsSectionParser is
responsible for parsing Chiefs section. It describes moving objects or
their groups. Each of them is defined on a separate line. There are 4 types of
moving objects:
- usual vehicles;
- armored vehicles;
- trains;
- ships.
First 3 types have same list of parameters. Ships have some extra parameters.
Section example:
[Chiefs]
0_Chief Armor.1-BT7 2
1_Chief Vehicles.GAZ67 1
2_Chief Trains.USSR_FuelTrain/AA 1
3_Chief Ships.Niobe 2
4_Chief Ships.G5 1 60 3 2.0
Output example:
{
'moving_units': [
{
'id': '0_Chief',
'code': '1-BT7',
'type': UnitTypes.armor,
'belligerent': Belligerents.blue,
},
{
'id': '1_Chief',
'code': 'GAZ67',
'type': UnitTypes.vehicle,
'belligerent': Belligerents.red,
},
{
'id': '2_Chief',
'code': 'USSR_FuelTrain/AA',
'type': UnitTypes.train,
'belligerent': Belligerents.red,
},
{
'id': '3_Chief',
'code': 'Niobe',
'type': UnitTypes.ship,
'belligerent': Belligerents.blue,
},
{
'id': '4_Chief',
'code': 'G5',
'type': UnitTypes.ship,
'belligerent': Belligerents.red,
'hibernation': 60,
'skill': Skills.ace,
'recharge_time': 2.0,
},
],
}
Description:
The output of the parser is a dictionary with moving_units element. It
contains a list of dictionaries containing information about each object.
5.7.1. Common parameters¶
Let’s examine common parameters using first line from example above:
0_Chief Armor.1-BT7 2
0_ChiefObject’s ID. Contains
Chiefword prefixed by a sequence number. This ID identifies a moving object or a group of them. In latter case, events log will contain this code followed by an in-group number of an object, e.g.:[5:25:14 PM] 0_Chief9 destroyed by 1_Chief2 at 11149.903 43949.902
Here we can see that 9th object from group
0_Chiefwas destroyed by 2nd object from group1_Chief.Output path: idOutput type: strOutput value: original string value Armor.1-BT7Defines unit type and object’s code.
Output path: typeOutput type: complex unit type constant Output path: codeOutput type: strOutput value: original string value 2Code number of army the object belongs to.
Output path: belligerentOutput type: complex belligerents constant
5.7.2. Ships extra parameters¶
Ships have 3 extra parameters. Let’s see an example:
3_Chief Ships.G5 1 60 3 2.0
First 3 parameters are similar to the ones described above. The other parameters are:
60Hibernation time (in minutes): during this time a ship will be inactive. After that it will start following own route.
Output path: hibernationOutput type: intOutput value: original value converted to integer number 3Skill level of gunners managing anti-aircraft guns.
Output path: skillOutput type: complex skills constant 2.0Recharge time (in minutes) of anti-aircraft guns of the ship.
Output path: recharge_timeOutput type: floatOutput value: original value converted to float number