OGWWorldCategories Class Reference
Inherits from | NSObject |
Declared in | OGWWorldCategories.h |
Overview
Stores and gives access to the world’s OGWEntityCategory objects.
Once added, a category can not be removed from the world other than by destroying the world. This is intentional, categories are not meant to be shuffled in and out of existance. You set up a world with categories before doing anything with the world.
Example usage:
OGWEntityCategory triggerCategory = [OGWEntityCategory categoryWithName:@“triggers”];
[triggerCategory addDefaultAspectClassesInArray:@[[OGWRemoveOnContactAspect class]]];
[world.categories addCategory:triggerCategory];
OGWEntityCategory platformsCategory = [OGWEntityCategory categoryWithName:@“platforms” needsUpdate:YES updateConcurrently:YES];
[platformsCategory addDefaultAspectClassesInArray:@[[OGWJobAspect class], [OGWKinematicsAspect class], [OGWPathMoveAspect class]]];
[world.categories addCategory:platformsCategory];
Properties
all
An array of all OGWEntityCategory objects registered with the world, in the order they were added.
@property (readonly) NSArray *all
Return Value
An array of all OGWEntityCategory objects registered with the world, in the order they were added.
Declared In
OGWWorldCategories.h
Instance Methods
addCategory:
Adds a category to the world.
- (void)addCategory:(const OGWEntityCategory *)category
Parameters
- category
A unique, non-nil OGWEntityCategory object.
Declared In
OGWWorldCategories.h
categoryForClass:
The Class of a category to look for.
- (const OGWEntityCategory *)categoryForClass:(Class)categoryClass
Parameters
- categoryClass
The Class of a category to look for.
Return Value
The category for the given class, or nil if there’s no category of this class.
See Also
Declared In
OGWWorldCategories.h
categoryForName:
The name of the category to look for.
- (const OGWEntityCategory *)categoryForName:(NSString *)name
Parameters
- name
The name of the category to look for.
Return Value
The category for the given name, or nil if there’s no category by this name.
See Also
Declared In
OGWWorldCategories.h