| 117 | } |
| 118 | |
| 119 | void CustomFunctionLibrary::RegisterStatFunctions() |
| 120 | { |
| 121 | auto & functionMgr = osiris_.GetCustomFunctionManager(); |
| 122 | |
| 123 | auto statExists = std::make_unique<CustomQuery>( |
| 124 | "NRD_StatExists", |
| 125 | std::vector<CustomFunctionParam>{ |
| 126 | { "StatsId", ValueType::String, FunctionArgumentDirection::In } |
| 127 | }, |
| 128 | &func::StatExists |
| 129 | ); |
| 130 | functionMgr.Register(std::move(statExists)); |
| 131 | |
| 132 | auto statAttributeExists = std::make_unique<CustomQuery>( |
| 133 | "NRD_StatAttributeExists", |
| 134 | std::vector<CustomFunctionParam>{ |
| 135 | { "StatsId", ValueType::String, FunctionArgumentDirection::In }, |
| 136 | { "Attribute", ValueType::String, FunctionArgumentDirection::In }, |
| 137 | }, |
| 138 | &func::StatAttributeExists |
| 139 | ); |
| 140 | functionMgr.Register(std::move(statAttributeExists)); |
| 141 | |
| 142 | auto getStatAttributeInt = std::make_unique<CustomQuery>( |
| 143 | "NRD_StatGetAttributeInt", |
| 144 | std::vector<CustomFunctionParam>{ |
| 145 | { "StatsId", ValueType::String, FunctionArgumentDirection::In }, |
| 146 | { "Attribute", ValueType::String, FunctionArgumentDirection::In }, |
| 147 | { "Value", ValueType::Integer, FunctionArgumentDirection::Out }, |
| 148 | }, |
| 149 | &func::StatGetAttributeInt |
| 150 | ); |
| 151 | functionMgr.Register(std::move(getStatAttributeInt)); |
| 152 | |
| 153 | auto getStatAttributeString = std::make_unique<CustomQuery>( |
| 154 | "NRD_StatGetAttributeString", |
| 155 | std::vector<CustomFunctionParam>{ |
| 156 | { "StatsId", ValueType::String, FunctionArgumentDirection::In }, |
| 157 | { "Attribute", ValueType::String, FunctionArgumentDirection::In }, |
| 158 | { "Value", ValueType::String, FunctionArgumentDirection::Out }, |
| 159 | }, |
| 160 | &func::StatGetAttributeString |
| 161 | ); |
| 162 | functionMgr.Register(std::move(getStatAttributeString)); |
| 163 | |
| 164 | auto getStatType = std::make_unique<CustomQuery>( |
| 165 | "NRD_StatGetType", |
| 166 | std::vector<CustomFunctionParam>{ |
| 167 | { "StatsId", ValueType::String, FunctionArgumentDirection::In }, |
| 168 | { "Type", ValueType::String, FunctionArgumentDirection::Out }, |
| 169 | }, |
| 170 | &func::StatGetType |
| 171 | ); |
| 172 | functionMgr.Register(std::move(getStatType)); |
| 173 | } |
| 174 | |
| 175 | } |