namespace Wizard.Battle.Player.ClassCharacter;

public class PlayerClassCharacter
{
	public ClassCharacterBase _class { get; protected set; }

	public PlayerClassCharacter(bool isPlayer)
	{
		DataMgr dataMgr = GameMgr.GetIns().GetDataMgr();
		if (isPlayer)
		{
			if (dataMgr.Is3DSkin(isPlayer))
			{
				_class = new Player3dClassCharacter(dataMgr.GetPlayerSkinId());
			}
			else if (dataMgr.IsHighRankSkinPlayer())
			{
				_class = new PlayerHighRankSpineClassCharacter();
			}
			else
			{
				_class = new PlayerSpineClassCharacter();
			}
		}
		else if (dataMgr.Is3DSkin(isPlayer))
		{
			_class = new Enemy3dClassCharacter(dataMgr.GetEnemySkinId());
		}
		else if (dataMgr.IsHighRankSkinEnemy())
		{
			_class = new EnemyHighRankSpineClassCharacter();
		}
		else
		{
			_class = new EnemySpineClassCharacter();
		}
	}

	public void OutFrame()
	{
		_class.OutFrame();
	}

	public void IntoFrame()
	{
		_class.IntoFrame();
	}

	public float GetCurrentClipTime()
	{
		return _class.GetCurrentClipTime();
	}

	public bool GetCurrentClipIsName(ClassCharaPrm.MotionType motionType)
	{
		return _class.GetCurrentClipIsName(motionType);
	}

	public void ClearSpineObject()
	{
		_class.ClearResourceObject();
	}
}
