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_Rocket
Rocket ID which is given by full mission editor. Contains
Rocket
word prefixed by a sequence number.Output path: id
Output type: str
Output value: original string value Fi103_V1_ramp
Code name.
Output path: code
Output type: str
Output value: original string value 2
Code number of army the object belongs to.
Output path: belligerent
Output type: complex belligerents constant 84141.38
X coordinate.
Output path: pos.x
Output type: float
Output value: original value converted to float number 114216.82
Y coordinate.
Output path: pos.y
Output type: float
Output value: original value converted to float number 360.00
Angle of rotation.
Output path: rotation_angle
Output type: float
Output value: original value converted to float number and taken modulo 360 60.0
Delay (in minutes): this parameter tells how much a rocket have to wait until it will be launched.
Output path: delay
Output type: float
Output value: original value converted to float number 10
Number of rockets to launch.
Output path: count
Output type: int
Output value: original value converted to integer number 80.0
Period of rocket launch.
Output path: period
Output type: float
Output value: original value converted to float number 83433.91
Destination X coordinate.
Output path: destination.x
Output type: float
Output value: original value converted to float number 115445.49
Destination Y coordinate.
Output path: destination.y
Output type: float
Output value: original value converted to float number