|
Oolite
|
#include <OORoleSet.h>
Instance Methods | |
| (id) | - initWithRoleString: |
| (id) | - initWithRole:probability: |
| (NSString *) | - roleString |
| (BOOL) | - hasRole: |
| (float) | - probabilityForRole: |
| (BOOL) | - intersectsSet: |
| (NSSet *) | - roles |
| (NSArray *) | - sortedRoles |
| (NSDictionary *) | - rolesAndProbabilities |
| (NSString *) | - anyRole |
| (id) | - roleSetWithAddedRole:probability: |
| (id) | - roleSetWithAddedRoleIfNotSet:probability: |
| (id) | - roleSetWithRemovedRole: |
| (void) | - dealloc [implementation] |
| (NSString *) | - description [implementation] |
| (BOOL) | - isEqual: [implementation] |
| (NSUInteger) | - hash [implementation] |
| (id) | - copyWithZone: [implementation] |
| (id) | - initWithRolesAndProbabilities: [implementation] |
Class Methods | |
| (instancetype) | + roleSetWithString: |
| (instancetype) | + roleSetWithRole:probability: |
Private Attributes | |
| NSString * | _roleString |
| NSDictionary * | _rolesAndProbabilities |
| NSSet * | _roles |
| float | _totalProb |
Definition at line 34 of file OORoleSet.h.
| - (NSString *) anyRole |
Definition at line 173 of file OORoleSet.m.
References _rolesAndProbabilities, _totalProb, anyRole, count, foreachkey, nil, OOLog, randf(), and roles.
Referenced by anyRole.
|
implementation |
Definition at line 97 of file OORoleSet.m.
|
implementation |
Definition at line 70 of file OORoleSet.m.
References dealloc.
Referenced by dealloc.
|
implementation |
Definition at line 79 of file OORoleSet.m.
References description, and roleString.
Referenced by description.
|
implementation |
Definition at line 92 of file OORoleSet.m.
References hash.
Referenced by hash.
| - (BOOL) hasRole: | (NSString*) | role |
Definition at line 135 of file OORoleSet.m.
References nil.
Referenced by ShipEntity::hasRole:, and ShipEntity::isBoulder.
| - (id) initWithRole: | (NSString*) | role | |
| probability: | (float) | probability |
Definition at line 60 of file OORoleSet.m.
References initWithRolesAndProbabilities:, and nil.
|
implementation |
Provided by category OORoleSet(OOPrivate).
Definition at line 239 of file OORoleSet.m.
Referenced by initWithRole:probability:, and initWithRoleString:.
| - (id) initWithRoleString: | (NSString*) | roleString |
Definition at line 52 of file OORoleSet.m.
References initWithRolesAndProbabilities:, nil, OOParseRolesFromString(), and roleString.
| - (BOOL) intersectsSet: | (id) | set |
Definition at line 145 of file OORoleSet.m.
References roles.
Referenced by HasRoleInSetPredicate().
|
implementation |
Definition at line 84 of file OORoleSet.m.
| - (float) probabilityForRole: | (NSString*) | role |
Definition at line 140 of file OORoleSet.m.
Referenced by roleString.
| - (NSSet *) roles |
Definition at line 155 of file OORoleSet.m.
References _roles, nil, and roles.
Referenced by anyRole, intersectsSet:, roles, and roleString.
| - (NSDictionary *) rolesAndProbabilities |
Definition at line 168 of file OORoleSet.m.
References _rolesAndProbabilities, and rolesAndProbabilities.
Referenced by rolesAndProbabilities, ShipGetProperty(), and ShipGetProperty().
| - (id) roleSetWithAddedRole: | (NSString*) | role | |
| probability: | (float) | probability |
Definition at line 210 of file OORoleSet.m.
References nil.
Referenced by ShipEntity::addRole:withProbability:.
| - (id) roleSetWithAddedRoleIfNotSet: | (NSString*) | role | |
| probability: | (float) | probability |
Definition at line 197 of file OORoleSet.m.
References nil.
| - (id) roleSetWithRemovedRole: | (NSString*) | role |
Definition at line 223 of file OORoleSet.m.
References nil.
Referenced by ShipEntity::removeRole:.
| + (instancetype) roleSetWithRole: | (NSString*) | role | |
| probability: | (float) | probability |
Definition at line 47 of file OORoleSet.m.
Referenced by ShipEntity::addRole:withProbability:.
| + (instancetype) roleSetWithString: | (NSString*) | roleString |
Definition at line 42 of file OORoleSet.m.
Referenced by ShipEntity::setUpShipFromDictionary:.
| - (NSString *) roleString |
Definition at line 103 of file OORoleSet.m.
References _roleString, nil, probabilityForRole:, roles, roleString, and sortedRoles.
Referenced by description, initWithRoleString:, roleString, and ShipEntity(LoadRestore)::savedShipDictionaryWithContext:.
| - (NSArray *) sortedRoles |
Definition at line 163 of file OORoleSet.m.
References sortedRoles.
Referenced by roleString, ShipGetProperty(), ShipGetProperty(), and sortedRoles.
|
private |
Definition at line 38 of file OORoleSet.h.
Referenced by roles.
|
private |
Definition at line 37 of file OORoleSet.h.
Referenced by anyRole, and rolesAndProbabilities.
|
private |
Definition at line 36 of file OORoleSet.h.
Referenced by roleString.
|
private |
Definition at line 39 of file OORoleSet.h.
Referenced by anyRole.