MCPcopy Create free account
hub / github.com/cocos/cocos-engine / typeAsNumber

Method typeAsNumber

native/cocos/network/SocketIO.cpp:161–168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

159 return encoded.str();
160}
161int SocketIOPacket::typeAsNumber() const {
162 ccstd::string::size_type num = 0;
163 auto item = std::find(_types.begin(), _types.end(), _type);
164 if (item != _types.end()) {
165 num = item - _types.begin();
166 }
167 return static_cast<int>(num);
168}
169const ccstd::string &SocketIOPacket::typeForIndex(int index) const {
170 return _types.at(index);
171}

Callers 1

toStringMethod · 0.95

Calls 3

endMethod · 0.65
findFunction · 0.50
beginMethod · 0.45

Tested by

no test coverage detected