punish v6.8.18.0
This commit is contained in:
commit
e786325cda
322 changed files with 554232 additions and 0 deletions
31
Questionable/Questionable.Data/AetherCurrentData.cs
Normal file
31
Questionable/Questionable.Data/AetherCurrentData.cs
Normal file
|
@ -0,0 +1,31 @@
|
|||
using System.Collections.Immutable;
|
||||
using System.Linq;
|
||||
using Dalamud.Plugin.Services;
|
||||
using Lumina.Excel;
|
||||
using Lumina.Excel.Sheets;
|
||||
|
||||
namespace Questionable.Data;
|
||||
|
||||
internal sealed class AetherCurrentData
|
||||
{
|
||||
private readonly ImmutableDictionary<ushort, ImmutableList<uint>> _overworldCurrents;
|
||||
|
||||
public AetherCurrentData(IDataManager dataManager)
|
||||
{
|
||||
_overworldCurrents = (from x in dataManager.GetExcelSheet<AetherCurrentCompFlgSet>()
|
||||
where x.RowId != 0
|
||||
where x.Territory.IsValid
|
||||
select x).ToImmutableDictionary((AetherCurrentCompFlgSet x) => (ushort)x.Territory.RowId, (AetherCurrentCompFlgSet x) => (from y in x.AetherCurrents
|
||||
where y.RowId != 0 && y.Value.Quest.RowId == 0
|
||||
select y.RowId).ToImmutableList());
|
||||
}
|
||||
|
||||
public bool IsValidAetherCurrent(ushort territoryId, uint aetherCurrentId)
|
||||
{
|
||||
if (_overworldCurrents.TryGetValue(territoryId, out ImmutableList<uint> value))
|
||||
{
|
||||
return value.Contains(aetherCurrentId);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue