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];

Tasks

Working with Categories

Internal Use Only

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

Class Methods

categoriesWithWorld:

+ (id)categoriesWithWorld:(OGWWorld *)world

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.

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.

Declared In

OGWWorldCategories.h