| 93 | } |
| 94 | |
| 95 | void * FindComponentByNameGuid(ComponentType componentType, std::string const & nameGuid, bool logError) |
| 96 | { |
| 97 | auto stringPtr = NameGuidToFixedString(nameGuid); |
| 98 | if (stringPtr == nullptr) { |
| 99 | OsiError("Could not map GUID '" << nameGuid << "' to FixedString"); |
| 100 | return nullptr; |
| 101 | } |
| 102 | |
| 103 | auto entityWorld = GetEntityWorld(); |
| 104 | if (entityWorld == nullptr) { |
| 105 | return nullptr; |
| 106 | } |
| 107 | |
| 108 | FixedString fs; |
| 109 | fs.Str = stringPtr; |
| 110 | |
| 111 | auto component = entityWorld->Components.Buf[(uint32_t)componentType].component->FindComponentByGuid(&fs); |
| 112 | if (component != nullptr) { |
| 113 | return component; |
| 114 | } else { |
| 115 | if (logError) { |
| 116 | OsiError("No " << (uint32_t)componentType << " component found with GUID '" << nameGuid << "'"); |
| 117 | } |
| 118 | return nullptr; |
| 119 | } |
| 120 | } |
| 121 | |
| 122 | void * FindComponentByHandle(ComponentType componentType, ObjectHandle const & handle, bool logError) |
| 123 | { |
no test coverage detected