muffin v7.5.6
This commit is contained in:
parent
6266f9e6b7
commit
addf2d530f
619 changed files with 264792 additions and 446022 deletions
62
Questionable/Questionable.Data/FishingData.cs
Normal file
62
Questionable/Questionable.Data/FishingData.cs
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using Dalamud.Plugin.Services;
|
||||
using Lumina.Excel;
|
||||
using Lumina.Excel.Sheets;
|
||||
|
||||
namespace Questionable.Data;
|
||||
|
||||
internal sealed class FishingData
|
||||
{
|
||||
private readonly Dictionary<uint, FishingSpotInfo> _itemToSpot;
|
||||
|
||||
public FishingData(IDataManager dataManager)
|
||||
{
|
||||
ExcelSheet<FishingSpot> excelSheet = dataManager.GetExcelSheet<FishingSpot>();
|
||||
Dictionary<uint, FishingSpotInfo> dictionary = new Dictionary<uint, FishingSpotInfo>();
|
||||
foreach (FishingSpot item in excelSheet)
|
||||
{
|
||||
if (item.RowId == 0 || item.TerritoryType.RowId == 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
FishingSpotInfo value = new FishingSpotInfo(item.RowId, (ushort)item.TerritoryType.RowId, item.X, item.Z, item.GatheringLevel);
|
||||
foreach (RowRef<Item> item2 in item.Item)
|
||||
{
|
||||
if (item2.RowId != 0 && (!dictionary.TryGetValue(item2.RowId, out var value2) || value2.GatheringLevel > value.GatheringLevel))
|
||||
{
|
||||
dictionary[item2.RowId] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
_itemToSpot = dictionary;
|
||||
}
|
||||
|
||||
public bool TryGetFishingSpot(uint itemId, [NotNullWhen(true)] out FishingSpotInfo? spot)
|
||||
{
|
||||
FishingSpotInfo value;
|
||||
int num = ((!_itemToSpot.TryGetValue(itemId, out value)) ? 254023319 : 254023316);
|
||||
while (true)
|
||||
{
|
||||
int num2 = num;
|
||||
int num3 = 254023318;
|
||||
int num4 = num2;
|
||||
int num5 = num4 + num3;
|
||||
int num6 = num4 & num3;
|
||||
switch (num5 - (num6 + num6))
|
||||
{
|
||||
case 1:
|
||||
spot = null;
|
||||
return false;
|
||||
case 2:
|
||||
spot = value;
|
||||
return true;
|
||||
case 0:
|
||||
goto IL_0067;
|
||||
}
|
||||
continue;
|
||||
IL_0067:
|
||||
num = 254023316;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue