30 lines
947 B
C#
30 lines
947 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using asap.core;
|
|
using cfg;
|
|
using GameCore;
|
|
|
|
namespace Activity.Condition
|
|
{
|
|
/// <summary>
|
|
/// 等级条件检查器
|
|
/// </summary>
|
|
public class AccountLevelConditionChecker : IConditionChecker
|
|
{
|
|
public int Priority => 20;
|
|
public List<Type> 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<PlayerData>().lv;
|
|
return currentLevel >= requiredLevel;
|
|
}
|
|
return true;
|
|
}
|
|
}
|
|
} |