AnimationStateMachineBehaviour* AnimationStateMachine::getBehaviour( const char* from, const char* to) { auto fromNode = getNode(from); auto toNode = getNode(to); auto ret = getBehaviour(fromNode, toNode); return ret; }
BehaviourID behaviour::create(EntityID ent) { BehaviourID ret = gBehaviourManager.add(); Behaviour& b = getBehaviour(ret); b._owner = ent; b._interface = 0; entity::addComponent(ent, ret, BEHAVIOUR); return ret; }
void behaviour::setInterface(BehaviourID behave,BehaviourInterface* behaviourInterface) { Behaviour& b = getBehaviour(behave); b._interface = behaviourInterface; if(b._interface) { foundation::array::push_back(*gSortedInterfaces, b._interface); qsort(gSortedInterfaces->_data, foundation::array::size(*gSortedInterfaces), sizeof(BehaviourInterface*), sortInterface); b._interface->_entity = b._owner; b._interface->created(); } }