/*
 * Derived from Epic Fight (https://github.com/Epic-Fight/epicfight)
 * by the Epic Fight Team, licensed under GPLv3.
 * Modifications © 2026 TiedUp! Remake Contributors, distributed under GPLv3.
 */

package com.tiedup.remake.rig.anim.types;

import org.jetbrains.annotations.ApiStatus;

import net.minecraft.resources.ResourceLocation;
import com.tiedup.remake.rig.anim.AnimationManager.AnimationAccessor;
import com.tiedup.remake.rig.asset.AssetAccessor;
import com.tiedup.remake.rig.armature.Armature;

public class DirectStaticAnimation extends StaticAnimation implements AnimationAccessor<DirectStaticAnimation> {
	private ResourceLocation registryName;
	
	public DirectStaticAnimation() {
		this.accessor = this;
	}
	
	public DirectStaticAnimation(float transitionTime, boolean isRepeat, ResourceLocation registryName, AssetAccessor<? extends Armature> armature) {
		super(transitionTime, isRepeat, registryName.toString(), armature);
		
		this.registryName = registryName;
		this.accessor = this;
	}
	
	/* Multilayer, Pov animation Constructor */
	@ApiStatus.Internal
	public DirectStaticAnimation(ResourceLocation baseAnimPath, float transitionTime, boolean repeatPlay, String registryName, AssetAccessor<? extends Armature> armature) {
		super(baseAnimPath, transitionTime, repeatPlay, registryName, armature);
		
		this.registryName = ResourceLocation.parse(registryName);
	}
	
	@Override
	public DirectStaticAnimation get() {
		return this;
	}
	
	@SuppressWarnings("unchecked")
	@Override
	public <A extends DynamicAnimation> AnimationAccessor<A> getAccessor() {
		return (AnimationAccessor<A>)this;
	}
	
	@Override
	public ResourceLocation registryName() {
		return this.registryName;
	}

	@Override
	public boolean isPresent() {
		return true;
	}

	@Override
	public int id() {
		return -1;
	}
	
	@Override
	public int getId() {
		return -1;
	}
	
	@Override
	public boolean inRegistry() {
		return false;
	}
}
