| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- #include "Base.h"
- #include "Animations.h"
- namespace gameplay
- {
- Animations::Animations(void)
- {
- // There will only be one Animations.
- // It requires an ID because it will be stores in the ref table.
- setId("__Animations__");
- }
- Animations::~Animations(void)
- {
- }
- unsigned int Animations::getTypeId(void) const
- {
- return ANIMATIONS_ID;
- }
- const char* Animations::getElementName(void) const
- {
- return "Animations";
- }
- void Animations::writeBinary(FILE* file)
- {
- Object::writeBinary(file);
- write(_animations.size(), file);
- for (std::vector<Animation*>::iterator i = _animations.begin(); i != _animations.end(); ++i)
- {
- (*i)->writeBinary(file);
- }
- }
- void Animations::writeText(FILE* file)
- {
- fprintElementStart(file);
- if (_animations.size() > 0 )
- {
- for (std::vector<Animation*>::iterator i = _animations.begin(); i != _animations.end(); ++i)
- {
- (*i)->writeText(file);
- }
- }
- fprintElementEnd(file);
- }
- void Animations::add(Animation* animation)
- {
- _animations.push_back(animation);
- }
- unsigned int Animations::getAnimationCount() const
- {
- return _animations.size();
- }
- Animation* Animations::getAnimation(unsigned int index) const
- {
- return _animations[index];
- }
- }
|