5.10. Buildings sectionΒΆ
Note
BuildingsSectionParser
is
responsible for parsing Buildings
section. Each line of this section
describes a single building.
Section example:
[Buildings]
0_bld House$Tent_Pyramid_US 1 43471.34 57962.08 630.00
Output example:
{
'buildings': [
Building(
id='0_bld',
belligerent=Belligerents.red,
code='Tent_Pyramid_US',
pos=Point2D(43471.34, 57962.08),
rotation_angle=270.00,
),
],
}
The result is a dict
with buildings
item which contains a list of
buildings.
We use Building
structure to
store information about buildings.
Description:
0_bld
Object ID which is given by full mission editor. Contains
bld
word prefixed by a sequence number.Output path: id
Output type: str
Output value: original string value House$Tent_Pyramid_US
Building type (
House
) and code name (Tent_Pyramid_US
). Type is not present in the output because all buildings have typehouse
.Output path: code
Output type: str
Output value: original string value 1
Code number of belligerent the object belongs to.
Output path: belligerent
Output type: complex belligerents constant 43471.34
X coordinate.
Output path: pos.x
Output type: float
Output value: original value converted to float number 57962.08
Y coordinate.
Output path: pos.y
Output type: float
Output value: original value converted to float number 630.00
Angle of rotation.
Output path: rotation_angle
Output type: float
Output value: original value converted to float number and taken modulo 360