|
bool? | GetBool (int rowIndex, int columnIndex) |
| Gets the specified boolean value.
|
|
bool? | GetBool (int rowIndex, string columnName) |
| Gets the specified boolean value.
|
|
int | GetColumnIndex (string columnName) |
| Gets the index of the column with the specified name/label.
|
|
T? | GetEnum< T > (int rowIndex, int columnIndex) |
| Gets the specified enum value value.
|
|
T? | GetEnum< T > (int rowIndex, string columnName) |
| Gets the specified StrRef value.
|
|
IEnumerator< T > | GetEnumerator () |
|
float? | GetFloat (int rowIndex, int columnIndex) |
| Gets the specified float value.
|
|
float? | GetFloat (int rowIndex, string columnName) |
| Gets the specified float value.
|
|
int? | GetInt (int rowIndex, int columnIndex) |
| Gets the specified int value.
|
|
int? | GetInt (int rowIndex, string columnName) |
| Gets the specified int value.
|
|
T | GetRow (int rowIndex) |
| Gets the row at the specified index.
|
|
string? | GetString (int rowIndex, int columnIndex) |
| Gets the specified string value.
|
|
string? | GetString (int rowIndex, string columnName) |
| Gets the specified string value.
|
|
StrRef? | GetStrRef (int rowIndex, int columnIndex) |
| Gets the specified StrRef value.
|
|
StrRef? | GetStrRef (int rowIndex, string columnName) |
| Gets the specified StrRef value.
|
|
TwoDimArray< T >? | GetTable< T > (int rowIndex, int columnIndex) |
| Interprets the specified value as a table name, and returns the associated table.
|
|
TwoDimArray< T >? | GetTable< T > (int rowIndex, string columnName) |
| Interprets the specified value as a table name, and returns the associated table.
|
|
T? | GetTableEntry< T > (int rowIndex, int columnIndex, TwoDimArray< T > table) |
| Interprets the specified value as a table index, and returns the associated table entry.
|
|
T? | GetTableEntry< T > (int rowIndex, string columnName, TwoDimArray< T > table) |
| Interprets the specified value as a table index, and returns the associated table entry.
|
|
Vector3? | GetVector3 (int rowIndex, int columnIndexX, int columnIndexY, int columnIndexZ) |
| Gets the specified Vector3 value.
|
|
Vector3? | GetVector3 (int rowIndex, string columnNameX, string columnNameY, string columnNameZ) |
| Gets the specified Vector3 value.
|
|
A two dimensional array data resource.
A two dimensional array resource, with a decoded row type.
Examples
using System.Linq;
namespace NWN.Anvil.Samples
{
{
public int Level { get; private set; }
public int XP { get; private set; }
public int RowIndex { get; init; }
{
Level = entry.
GetInt(
"Level").GetValueOrDefault(0);
XP = entry.
GetInt(
"XP").GetValueOrDefault(0);
}
}
[ServiceBinding(typeof(XPReportService))]
public class XPReportService
{
public XPReportService()
{
NwModule.Instance.OnClientEnter += OnClientEnter;
}
{
if (creature == null)
{
return;
}
int nextLevel = GetLevelFromXp(creature.
Xp) + 1;
if (nextLevel > MaxLevel)
{
return;
}
player.
SendServerMessage($
"Next level up: {GetXpForLevel(nextLevel) - creature.Xp}");
}
public int MaxLevel => expTable[^1].Level;
public int GetXpForLevel(int level)
{
return expTable.First(entry => entry.Level == level).XP;
}
public int GetLevelFromXp(int xp)
{
int level = 1;
{
{
break;
}
}
return level;
}
}
}
- Template Parameters
-
T | The row/entry type to decode the array. |