| 27 | } |
| 28 | |
| 29 | bool CustomFunction::ValidateParam(CustomFunctionParam const & param, OsiArgumentValue const & value) const |
| 30 | { |
| 31 | if (param.Type == ValueType::None |
| 32 | || param.Dir == FunctionArgumentDirection::Out) { |
| 33 | return true; |
| 34 | } |
| 35 | |
| 36 | auto typeId = value.TypeId; |
| 37 | if (typeId == ValueType::CharacterGuid |
| 38 | || typeId == ValueType::ItemGuid |
| 39 | || typeId == ValueType::TriggerGuid |
| 40 | || typeId == ValueType::SplineGuid |
| 41 | || typeId == ValueType::LevelTemplateGuid) { |
| 42 | typeId = ValueType::GuidString; |
| 43 | } |
| 44 | |
| 45 | auto paramTypeId = param.Type; |
| 46 | if (paramTypeId == ValueType::CharacterGuid |
| 47 | || paramTypeId == ValueType::ItemGuid |
| 48 | || paramTypeId == ValueType::TriggerGuid |
| 49 | || paramTypeId == ValueType::SplineGuid |
| 50 | || paramTypeId == ValueType::LevelTemplateGuid) { |
| 51 | paramTypeId = ValueType::GuidString; |
| 52 | } |
| 53 | |
| 54 | if (typeId != paramTypeId) { |
| 55 | OsiError("Function " << name_ << "/" << params_.size() << ": Argument '" << param.Name |
| 56 | << "' type mismatch; expected " << (unsigned)paramTypeId << ", got " << (unsigned)typeId); |
| 57 | return false; |
| 58 | } |
| 59 | |
| 60 | return true; |
| 61 | } |
| 62 | |
| 63 | void CustomFunction::GenerateHeader(std::stringstream & ss) const |
| 64 | { |
nothing calls this directly
no outgoing calls
no test coverage detected