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_bldObject ID which is given by full mission editor. Contains
bldword prefixed by a sequence number.Output path: idOutput type: strOutput value: original string value House$Tent_Pyramid_USBuilding type (
House) and code name (Tent_Pyramid_US). Type is not present in the output because all buildings have typehouse.Output path: codeOutput type: strOutput value: original string value 1Code number of belligerent the object belongs to.
Output path: belligerentOutput type: complex belligerents constant 43471.34X coordinate.
Output path: pos.xOutput type: floatOutput value: original value converted to float number 57962.08Y coordinate.
Output path: pos.yOutput type: floatOutput value: original value converted to float number 630.00Angle of rotation.
Output path: rotation_angleOutput type: floatOutput value: original value converted to float number and taken modulo 360