| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- #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);
- }
- }
|