# Noble

# 说明

Noble命名空间提供了SDK的核心功能。

# 如何使用

// 初始化SDK
Noble::Init(PluginType::Utility, "MyUtility");

// 导出和导入数据
Noble::ExportSDK("MyNamespace", "MyFunction", "12345");
uintptr_t ptr = Noble::ImportSDK("MyNamespace", "MyFunction");

// 获取Noble的安装路径
std::string path = Noble::GetPath();

# Init

void Init(PluginType plugin_type, const char* plugin_name, std::vector<std::string> const& supported_champions = {})

初始化SDK,必须在使用其他SDK功能前调用。

参数名字 参数类型 描述
plugin_type PluginType 插件类型,可选值为Champion(1)或Utility(2)
plugin_name const char* 插件名称
supported_champions std::vectorstd::string 支持的英雄列表,默认为空
// 初始化一个功能插件
Noble::Init(PluginType::Utility, "MyUtility");

// 初始化一个支持特定英雄的插件
std::vector<std::string> champions = {"Ahri", "Ashe", "Ezreal"};
Noble::Init(PluginType::Champion, "MyChampionPlugin", champions);

# ExportSDK

void ExportSDK(const char* Name, const char* Key, const char* data)

向SDK导出数据,用于共享功能或信息。

参数名字 参数类型 描述
Name const char* 导出数据的命名空间名称
Key const char* 导出数据的键名
data const char* 要导出的数据
// 导出数据
Noble::ExportSDK("MyNamespace", "MyFunction", "12345");

# ImportSDK

uintptr_t ImportSDK(const char* Name, const char* Key)

从SDK导入数据,返回导入的数据的指针。

参数名字 参数类型 描述
Name const char* 要导入数据的命名空间名称
Key const char* 要导入数据的键名
// 导入数据
uintptr_t ptr = Noble::ImportSDK("MyNamespace", "MyFunction");

# GetPath

std::string GetPath()

获取Noble的安装路径。

// 获取Noble的安装路径
std::string path = Noble::GetPath();
Console::Add("Noble的安装路径: %s", path.c_str());