using System;
using System.Collections.Generic;
using asap.core;
using cfg;
using GameCore;
namespace Activity.Condition
{
///
/// 等级条件检查器
///
public class AccountLevelConditionChecker : IConditionChecker
{
public int Priority => 20;
public List CareDataChangeWithType => new() { typeof(PlayerData) };
public bool NeedContinueListenAfterSatisfied => false;
public bool CanOpen(FishingEvent fishingEvent)
{
foreach (var condition in fishingEvent.ConditionList)
{
if (condition.Condition != ConditionType.AccountLevel) continue;
var requiredLevel = GlobalUtils.TryParseInt(condition.Param[0], 0);
var currentLevel = GContext.container.Resolve().lv;
return currentLevel >= requiredLevel;
}
return true;
}
}
}