Aw bool
Jump to navigation
Jump to search
Minimum requirements | ||
---|---|---|
Added in version 2.1 | ||
SDK | build 13 |
int aw_bool (AW_ATTRIBUTE a)
Description
Returns the value of boolean attribute.
Callback
None (returns immediately)
Notes
This method functions just like aw_int when an integer attribute is passed to it (e.g. aw_bool (AW_UNIVERSE_TIME)).
See SDK Attributes for more information.
Arguments
- a
- Attribute (defined in Aw.h).
Argument attributes
None
Return values
- 0
- False. It is also returned if the attribute is not boolean or integer, is outside the range of defined attributes (i.e. 0 to AW_MAX_ATTRIBUTE - 1), or when there is no current instance (i.e. aw_instance () returns NULL).
- 1
- True.
Returned attributes
None
Usage
void handle_world_attributes (void) { if (aw_bool (AW_WORLD_ALLOW_FLYING)) printf ("Flying is allowed in this world\n"); else printf ("Flying is not allowed in this world\n"); } aw_event_set (AW_EVENT_WORLD_ATTRIBUTES, handle_world_attributes);