You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.0 KiB
40 lines
1.0 KiB
using ProtoCSStruct;
|
|
using Sog;
|
|
|
|
namespace Game
|
|
{
|
|
public static class SystemUnlockSvc
|
|
{
|
|
public static bool IsUnlockSys(PlayerOnGame player, SystemUnlockId id)
|
|
{
|
|
return IsUnlockSys(player, (int)id);
|
|
}
|
|
|
|
public static bool IsUnlockSys(PlayerOnGame player, int id)
|
|
{
|
|
return _isUnlockSys(player.RoleData.SysUnlockData, id);
|
|
}
|
|
|
|
public static bool IsUnlockSys(DBSysUnlockData lockData, SystemUnlockId id)
|
|
{
|
|
return _isUnlockSys(lockData, (int)id);
|
|
}
|
|
|
|
private static bool _isUnlockSys(DBSysUnlockData lockData, int id)
|
|
{
|
|
if (id == 0)
|
|
{
|
|
return true;
|
|
}
|
|
var unlock = false;
|
|
for (var i = 0; i < lockData.SysUnlockDataOne.Count; i++)
|
|
{
|
|
if (lockData.SysUnlockDataOne[i].SysID != (int)id) continue;
|
|
unlock = true;
|
|
break;
|
|
}
|
|
|
|
return unlock;
|
|
}
|
|
}
|
|
}
|