|
| bool? | GetBool (int columnIndex) |
| | Gets the specified boolean value.
|
| |
| bool? | GetBool (string columnName) |
| | Gets the specified boolean value.
|
| |
| T? | GetEnum< T > (int columnIndex) |
| | Gets the specified enum value.
|
| |
| T? | GetEnum< T > (string columnName) |
| | Gets the specified enum value.
|
| |
| float? | GetFloat (int columnIndex) |
| | Gets the specified float value.
|
| |
| float? | GetFloat (string columnName) |
| | Gets the specified float value.
|
| |
| int? | GetInt (int columnIndex) |
| | Gets the specified int value.
|
| |
| int? | GetInt (string columnName) |
| | Gets the specified int value.
|
| |
| string? | GetString (int columnIndex) |
| | Gets the specified string value.
|
| |
| string? | GetString (string columnName) |
| | Gets the specified string value.
|
| |
| StrRef? | GetStrRef (int columnIndex) |
| | Gets the specified StrRef value.
|
| |
| StrRef? | GetStrRef (string columnName) |
| | Gets the specified StrRef value.
|
| |
| TwoDimArray< T >? | GetTable< T > (int columnIndex) |
| | Interprets the specified value as a table index, and returns the associated table entry.
|
| |
| TwoDimArray< T >? | GetTable< T > (string columnName) |
| | Interprets the specified value as a table index, and returns the associated table entry.
|
| |
| T? | GetTableEntry< T > (int columnIndex, TwoDimArray< T > table) |
| | Interprets the specified value as a table index, and returns the associated table entry.
|
| |
| T? | GetTableEntry< T > (string columnName, TwoDimArray< T > table) |
| | Interprets the specified value as a table index, and returns the associated table entry.
|
| |
| Vector3? | GetVector3 (int columnIndexX, int columnIndexY, int columnIndexZ) |
| | Gets the specified Vector3 value.
|
| |
| Vector3? | GetVector3 (string columnNameX, string columnNameY, string columnNameZ) |
| | Gets the specified Vector3 value.
|
| |
2da row data.
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;
}
}
}