src/behavior.c

changeset 265
5c915d01bdc0
parent 197
a1f7c4f858d9
equal deleted inserted replaced
264:653869cd653f 265:5c915d01bdc0
96 96
97 cxstring asc_behavior_get_name(const AscBehavior *behavior) { 97 cxstring asc_behavior_get_name(const AscBehavior *behavior) {
98 assert(behavior != NULL); 98 assert(behavior != NULL);
99 return cx_strcast(behavior->name); 99 return cx_strcast(behavior->name);
100 } 100 }
101
102 // TODO: add asc_behavior_find() and asc_behavior_find_global()
103
104 void asc_behavior_enable_all(AscSceneNode *node) {
105 CxIterator iter = cxListIterator(node->behaviors);
106 cx_foreach(AscBehavior*, behavior, iter) {
107 behavior->enabled = true;
108 }
109 }
110
111 void asc_behavior_disable_all(AscSceneNode *node) {
112 CxIterator iter = cxListIterator(node->behaviors);
113 cx_foreach(AscBehavior*, behavior, iter) {
114 behavior->enabled = false;
115 }
116 }

mercurial