rive_rs/importers/
artboard_importer.rsuse crate::animation::{LinearAnimation, StateMachine};
use crate::artboard::Artboard;
use crate::core::Object;
use crate::importers::ImportStackObject;
use crate::status_code::StatusCode;
#[derive(Debug)]
pub struct ArtboardImporter {
artboard: Object<Artboard>,
}
impl ArtboardImporter {
pub fn new(artboard: Object<Artboard>) -> Self {
Self { artboard }
}
pub fn push_object(&self, object: Object) {
self.artboard.as_ref().push_object(object);
}
pub fn push_animation(&self, animation: Object<LinearAnimation>) {
self.artboard.as_ref().push_animation(animation);
}
pub fn _push_state_machine(&self, state_machine: Object<StateMachine>) {
self.artboard.as_ref().push_state_machine(state_machine);
}
}
impl ImportStackObject for ArtboardImporter {
fn resolve(&self) -> StatusCode {
self.artboard.as_ref().initialize()
}
}