src/behavior.c

changeset 277
9988e327176f
parent 276
789215559ea8
child 278
634fa2996d4e
equal deleted inserted replaced
276:789215559ea8 277:9988e327176f
93 cxstring asc_behavior_get_name(const AscBehavior *behavior) { 93 cxstring asc_behavior_get_name(const AscBehavior *behavior) {
94 assert(behavior != NULL); 94 assert(behavior != NULL);
95 return cx_strcast(behavior->name); 95 return cx_strcast(behavior->name);
96 } 96 }
97 97
98 // TODO: add asc_behavior_find() and asc_behavior_find_global() 98 AscBehavior *asc_behavior_find_(const AscSceneNode *node, cxstring name) {
99 return cxMapGet(node->behaviors, name);
100 }
99 101
100 void asc_behavior_enable_all(AscSceneNode *node) { 102 void asc_behavior_enable_all(AscSceneNode *node) {
101 CxMapIterator iter = cxMapIteratorValues(node->behaviors); 103 CxMapIterator iter = cxMapIteratorValues(node->behaviors);
102 cx_foreach(AscBehavior*, behavior, iter) { 104 cx_foreach(AscBehavior*, behavior, iter) {
103 asc_behavior_enable(behavior); 105 asc_behavior_enable(behavior);

mercurial