Skip to content

Commit

Permalink
feat: add IsTestDC func
Browse files Browse the repository at this point in the history
  • Loading branch information
kalilistic committed Oct 21, 2023
1 parent b7418bc commit d3ce9bb
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Dalamud.DrunkenToad/Extensions/DataManagerExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,18 @@ public static uint WorldId(this IDataManager value, string worldName)
/// <returns>world name.</returns>
public static string WorldName(this IDataManager value, uint worldId) => value.GetExcelSheet<World>()?.GetRow(worldId)?.Name.ToString() ?? string.Empty;

/// <summary>
/// Get indicator whether world is a test data center.
/// </summary>
/// <param name="value">data manager.</param>
/// <param name="worldId">world id.</param>
/// <returns>indicator whether world is a test data center.</returns>
public static bool IsTestDC(this IDataManager value, uint worldId)
{
var world = value.GetExcelSheet<World>()?.GetRow(worldId);
return world?.DataCenter?.Value?.RowId == 12;
}

private static uint GetContentId(IDataManager value, ushort territoryType) => value.GetExcelSheet<ContentFinderCondition>() !
.FirstOrDefault(condition =>
condition.TerritoryType.Row == territoryType)?.RowId ??
Expand Down

0 comments on commit d3ce9bb

Please sign in to comment.