def from_gas(cls, decal_section: Section) -> Decal: assert decal_section.header == 't:decal,n:*' guid = decal_section.get_attr_value('guid') texture = decal_section.get_attr_value('texture') near_plane = decal_section.get_attr_value('near_plane') far_plane = decal_section.get_attr_value('far_plane') vertical_meters = decal_section.get_attr_value('vertical_meters') horizontal_meters = decal_section.get_attr_value('horizontal_meters') decal_origin = Position.parse( decal_section.get_attr_value('decal_origin')) decal_orientation = [ float(x) for x in decal_section.get_attr_value( 'decal_orientation').split(',') ] lod = decal_section.get_attr_value('lod') return Decal(guid, texture, near_plane, far_plane, vertical_meters, horizontal_meters, decal_origin, decal_orientation, lod)
def from_gas_section(cls, section: Section): x = section.get_attr_value('x') y = section.get_attr_value('y') z = section.get_attr_value('z') node = section.get_attr_value('node') return PosDir(x, y, z, node)
def load_gas(cls, section: Section) -> ProgressionStep: plants_profile = cls.load_profiles(section, 'plants') enemies_profile = cls.load_profiles(section, 'enemies') node_set = section.get_attr_value('node_set') return ProgressionStep(plants_profile, enemies_profile, node_set)
def from_gas_section(cls, section: Section): assert section.has_t_n_header() type_name, n = section.get_t_n_header() assert type_name in ['point', 'spot', 'directional'] assert n.startswith('light_') light: Light = PointLight() if type_name == 'point' else SpotLight( ) if type_name == 'spot' else DirectionalLight() light.id = Hex.parse(n[6:]) light.active = section.get_attr_value('active') light.affects_actors = section.get_attr_value('affects_actors') light.affects_items = section.get_attr_value('affects_items') light.affects_terrain = section.get_attr_value('affects_terrain') light.color = Color(section.get_attr_value('color')) light.draw_shadow = section.get_attr_value('draw_shadow') light.inner_radius = section.get_attr_value('inner_radius') light.intensity = section.get_attr_value('intensity') light.occlude_geometry = section.get_attr_value('occlude_geometry') light.on_timer = section.get_attr_value('on_timer') light.outer_radius = section.get_attr_value('outer_radius') if type_name in ['point', 'spot']: light.position = PosDir.from_gas_section( section.get_section('position')) if type_name in ['directional', 'spot']: light.direction = PosDir.from_gas_section( section.get_section('direction')) return light