forked from aya/aya
Initial commit
This commit is contained in:
43
engine/app/src/DataModel/Animation.hpp
Normal file
43
engine/app/src/DataModel/Animation.hpp
Normal file
@@ -0,0 +1,43 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Tree/Instance.hpp"
|
||||
#include "Utility/AnimationId.hpp"
|
||||
|
||||
namespace Aya
|
||||
{
|
||||
extern const char* const sAnimation;
|
||||
|
||||
class KeyframeSequence;
|
||||
class Animation : public DescribedCreatable<Animation, Instance, sAnimation>
|
||||
{
|
||||
private:
|
||||
typedef DescribedCreatable<Animation, Instance, sAnimation> Super;
|
||||
ContentId assetId;
|
||||
|
||||
public:
|
||||
Animation();
|
||||
|
||||
shared_ptr<const KeyframeSequence> getKeyframeSequence() const;
|
||||
|
||||
shared_ptr<const KeyframeSequence> getKeyframeSequence(const Instance* context) const;
|
||||
|
||||
AnimationId getAssetId() const
|
||||
{
|
||||
return assetId;
|
||||
}
|
||||
void setAssetId(AnimationId value);
|
||||
|
||||
bool isEmbeddedAsset() const;
|
||||
|
||||
/*override*/ bool askSetParent(const Instance* instance) const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
/*override*/ int getPersistentDataCost() const
|
||||
{
|
||||
return Super::getPersistentDataCost() + Instance::computeStringCost(getAssetId().toString());
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace Aya
|
||||
Reference in New Issue
Block a user