blob: 6e9b20b7bd43bd5ab96d25c1c2d6887518ce6ad6 [file] [log] [blame]
#include "rive/generated/animation/layer_state_base.hpp"
#include <stdio.h>
#include <vector>
namespace rive {
class ArtboardInstance;
class StateTransition;
class LayerStateImporter;
class StateMachineLayerImporter;
class StateInstance;
class LayerState : public LayerStateBase {
friend class LayerStateImporter;
friend class StateMachineLayerImporter;
std::vector<StateTransition*> m_Transitions;
void addTransition(StateTransition* transition);
StatusCode onAddedDirty(CoreContext* context) override;
StatusCode onAddedClean(CoreContext* context) override;
StatusCode import(ImportStack& importStack) override;
size_t transitionCount() const { return m_Transitions.size(); }
StateTransition* transition(size_t index) const {
if (index < m_Transitions.size()) {
return m_Transitions[index];
return nullptr;
/// Make an instance of this state that can be advanced and applied by
/// the state machine when it is active or being transitioned from.
virtual std::unique_ptr<StateInstance> makeInstance(ArtboardInstance* instance) const;
} // namespace rive