5.17. Rocket sectionΒΆ
Note
RocketSectionParser is
responsible for parsing Rocket section. Each line of this section describes
a single launchable rocket.
Section example:
[Rocket]
0_Rocket Fi103_V1_ramp 2 84141.38 114216.82 360.00 60.0 10 80.0 83433.91 115445.49
1_Rocket Fi103_V1_ramp 2 84141.38 114216.82 360.00 60.0 10 80.0
Output example:
{
'rockets': [
Rocket(
id='0_Rocket',
code='Fi103_V1_ramp',
belligerent=Belligerents.blue,
pos=Point2D(84141.38, 114216.82),
rotation_angle=0.00,
delay=60.0,
count=10,
period=80.0,
destination=Point2D(83433.91, 115445.49),
),
Rocket(
id='1_Rocket',
code='Fi103_V1_ramp',
belligerent=Belligerents.blue,
pos=Point2D(84141.38, 114216.82),
rotation_angle=0.00,
delay=60.0,
count=10,
period=80.0,
destination=None,
),
],
}
The output of the parser is a dict with rockets item. It contains
a list of dictionaries where each dictionary represents a single rocket.
A line can have 2 optional parameters: X and Y destination coordinates.
Let’s examine the first line.
0_RocketRocket ID which is given by full mission editor. Contains
Rocketword prefixed by a sequence number.Output path: idOutput type: strOutput value: original string value Fi103_V1_rampCode name.
Output path: codeOutput type: strOutput value: original string value 2Code number of army the object belongs to.
Output path: belligerentOutput type: complex belligerents constant 84141.38X coordinate.
Output path: pos.xOutput type: floatOutput value: original value converted to float number 114216.82Y coordinate.
Output path: pos.yOutput type: floatOutput value: original value converted to float number 360.00Angle of rotation.
Output path: rotation_angleOutput type: floatOutput value: original value converted to float number and taken modulo 360 60.0Delay (in minutes): this parameter tells how much a rocket have to wait until it will be launched.
Output path: delayOutput type: floatOutput value: original value converted to float number 10Number of rockets to launch.
Output path: countOutput type: intOutput value: original value converted to integer number 80.0Period of rocket launch.
Output path: periodOutput type: floatOutput value: original value converted to float number 83433.91Destination X coordinate.
Output path: destination.xOutput type: floatOutput value: original value converted to float number 115445.49Destination Y coordinate.
Output path: destination.yOutput type: floatOutput value: original value converted to float number