using System;
using Cute;
using Wizard.Battle.View.Vfx;

namespace Wizard.Battle.Resource;

public class RecoveryBattleResourceMgr : BattleResourceMgr
{
	private bool _enable;

	public override VfxBase LoadAsset(string path, ResourcesManager.AssetLoadPathType pathType, Action action)
	{
		if (_enable)
		{
			return base.LoadAsset(path, pathType, action);
		}
		return NullVfx.GetInstance();
	}

	public override VfxBase LoadAsset(string fullPath, Action action)
	{
		if (_enable)
		{
			return base.LoadAsset(fullPath, action);
		}
		return NullVfx.GetInstance();
	}

	public override VfxBase LoadEffectBattle(string objectFullPath, string objectPath, string sePath)
	{
		if (_enable)
		{
			return base.LoadEffectBattle(objectFullPath, objectPath, sePath);
		}
		return NullVfx.GetInstance();
	}

	public override VfxBase LoadAndCreateEffectBattleInstance(string objectPath, EffectMgr.EngineType engineType, string sePath, Action<EffectBattle> loadEndCallback)
	{
		if (_enable)
		{
			return base.LoadAndCreateEffectBattleInstance(objectPath, engineType, sePath, loadEndCallback);
		}
		return NullVfx.GetInstance();
	}

	public void EnableLoadResouce()
	{
		_enable = true;
	}
}
