IMonsterDatabase
用于查询怪物数据库的只读契约。这是所有数据库查询的公开 API 接口面。
命名空间:OpenMon.MCE.SDK
定义
public interface IMonsterDatabase
{
MonsterEntry GetMonster(uint dexNumber);
MonsterEntry GetMonster(string name);
IReadOnlyList<MonsterEntry> GetAllMonsters();
Move GetMove(string name);
IReadOnlyList<Move> GetAllMoves();
Ability GetAbility(string name);
IReadOnlyList<Ability> GetAllAbilities();
Item GetItem(string name);
IReadOnlyList<Item> GetAllItems();
IReadOnlyList<MonsterType> GetAllTypes();
float GetTypeEffectiveness(MonsterType attackingType, MonsterType defendingType);
IReadOnlyList<Form> GetAllForms();
int MonsterCount { get; }
}
方法
GetMonster(uint dexNumber)
按全国图鉴编号获取一个怪物条目。
| 参数 | 类型 | 说明 |
|---|---|---|
dexNumber | uint | 唯一的图鉴编号 |
返回:MonsterEntry,未找到时返回 null。
GetMonster(string name)
按物种名称获取一个怪物条目。
| 参数 | 类型 | 说明 |
|---|---|---|
name | string | 物种名称(区分大小写) |
返回:MonsterEntry,未找到时返回 null。
GetAllMonsters()
获取数据库中所有已注册的怪物条目。
返回:IReadOnlyList<MonsterEntry> —— 所有物种,按图鉴编号排序。
GetMove(string name)
按名称获取一个招式。
返回:Move,未找到时返回 null。
GetAllMoves()
获取所有已注册的招式。
返回:IReadOnlyList<Move> —— 全部 640+ 个招式。
GetAbility(string name)
按名称获取一个特性。