Files
test/Assets/PerfectWorld/Scripts/Utils/EC_ElementDataHelper.cs
2025-12-26 11:47:55 +07:00

45 lines
1.9 KiB
C#

namespace BrewMonster.Utils
{
public static class EC_ElementDataHelper
{
public static MINE_ESSENCE GetMine(int id){
MINE_ESSENCE result = default;
if (id > 0){
DATA_TYPE DataType = DATA_TYPE.DT_INVALID;
var pDataPtr = ElementDataManProvider.GetElementDataMan().get_data_ptr((uint)id, ID_SPACE.ID_SPACE_ESSENCE,ref DataType);
if (pDataPtr!=null && DataType == DATA_TYPE.DT_MINE_ESSENCE){
result = (MINE_ESSENCE)pDataPtr;
}
}
return result;
}
public static int GetGatherStartActionConfig(int gatherItemID){
// int result = 0;
MINE_ESSENCE pMine = GetMine(gatherItemID);
// if (pMine != default){ // hmm check null struct
// result = (int)pMine.gather_start_action_config;
// }
return (int)pMine.gather_start_action_config;
}
public static int GetGatherLoopActionConfig(int gatherItemID){
// int result(0);
MINE_ESSENCE pMine = GetMine(gatherItemID);
// if (const MINE_ESSENCE *pMine = GetMine(gatherItemID)){
// result = pMine->gather_loop_action_config;
// }
return (int)pMine.gather_loop_action_config;
}
// const SELL_CERTIFICATE_ESSENCE * GetCertificate(int id){
// const SELL_CERTIFICATE_ESSENCE *result = NULL;
// if (id > 0){
// DATA_TYPE DataType = DT_INVALID;
// const void* pDataPtr = g_pGame->GetElementDataMan()->get_data_ptr(id, ID_SPACE_ESSENCE, DataType);
// if (pDataPtr && DataType == DT_SELL_CERTIFICATE_ESSENCE){
// result = (const SELL_CERTIFICATE_ESSENCE *)pDataPtr;
// }
// }
// return result;
// }
}
}