MCPcopy Create free account
hub / github.com/ddnet/ddnet / GetExternalItemType

Method GetExternalItemType

src/engine/shared/snapshot.cpp:42–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40}
41
42int CSnapshot::GetExternalItemType(int InternalType) const
43{
44 if(InternalType < OFFSET_UUID_TYPE)
45 {
46 return InternalType;
47 }
48
49 int TypeItemIndex = GetItemIndex(InternalType); // NETOBJTYPE_EX
50 if(TypeItemIndex == -1 || GetItemSize(TypeItemIndex) < (int)sizeof(CUuid))
51 {
52 return InternalType;
53 }
54 const CSnapshotItem *pTypeItem = GetItem(TypeItemIndex);
55 CUuid Uuid;
56 for(size_t i = 0; i < sizeof(CUuid) / sizeof(int32_t); i++)
57 uint_to_bytes_be(&Uuid.m_aData[i * sizeof(int32_t)], pTypeItem->Data()[i]);
58
59 return g_UuidManager.LookupUuid(Uuid);
60}
61
62int CSnapshot::GetItemIndex(int Key) const
63{

Callers

nothing calls this directly

Calls 3

uint_to_bytes_beFunction · 0.85
LookupUuidMethod · 0.80
DataMethod · 0.45

Tested by

no test coverage detected