FgdEntityProperty¶
- class valvefgd.FgdEntityProperty(name, value_type, readonly=False, report=False, display_name=None, default_value=None, description=None, choices=[])[source]¶
An entity property, as represented in a Fgd file.
- __init__(name, value_type, readonly=False, report=False, display_name=None, default_value=None, description=None, choices=[])[source]¶
Creates an instance of FgdEntityProperty.
- Parameters:
name (str) – The property’s name.
value_type (str) – The property’s value type. Ex:’integer’, ‘float’, ‘choices’, etc…
readonly (bool, optional) – The property’s readonly status.
report (bool, optional) – The property’s report status.
display_name (str, optional) – The property’s display name.
default_value (str, optional) – The property’s unparsed default value.
description (str, optional) – The property’s description.
choices (list[FgdEntityPropertyChoice], optional) – The property’s choices. (applicable only to value_type “choices”)
- __repr__()[source]¶
A partial, printable summary of a FgdEntityProperty.
- Returns:
A Python formated string.
- Return type:
- property schema¶
A schematic view of this entity property’s attributes.
- Returns:
A dictionary
- Return type:
- property readonly¶
The property’s readonly status. (disables editing property in Hammer)
- Return type:
- property report¶
The property’s report status. (displays property value in Hammer’s entity report)
- Return type:
- property choices¶
The property’s choices.
- Return type:
- choice_by_value(choice_value)[source]¶
Finds a property choice by its value
- Parameters:
choice_value (int) – The property choice value to look for.
- Raises:
ChoiceNotFound – Whenever a property choice could not be found.
- Returns:
A property choice with matching value.
- Return type: