#include "bones/BoneAnimationList.h" #include #include "bones/BoneAnimationSequence.h" BoneAnimationList * BoneAnimationList_create() { BoneAnimationList * self; self = malloc(sizeof(BoneAnimationList)); BoneAnimationList_init(self); return self; } void BoneAnimationList_init(BoneAnimationList * self) { self->numberOfSequences = 0; self->sequences = NULL; self->dispose = BoneAnimationList_dispose; self->getSequence = BoneAnimationList_getSequence; } void BoneAnimationList_dispose(void * selfPtr) { BoneAnimationList * self = selfPtr; free(self->sequences); free(self); } BoneAnimationSequence * BoneAnimationList_getSequence(void * selfPtr, Atom sequenceName) { BoneAnimationList * self = selfPtr; unsigned int sequenceIndex; for (sequenceIndex = 0; sequenceIndex < self->numberOfSequences; sequenceIndex++) { if (self->sequences[sequenceIndex]->name == sequenceName) { return self->sequences[sequenceIndex]; } } return NULL; }