MCPcopy Create free account
hub / github.com/GlobedGD/globed2 / handleEvent

Method handleEvent

src/modules/two-player/TwoPlayerModule.cpp:262–270  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

260}
261
262void TwoPlayerModule::handleEvent(const InEvent& event) {
263 if (event.is<TwoPlayerLinkRequestEvent>()) {
264 auto& ev = event.as<TwoPlayerLinkRequestEvent>();
265 this->handleLinkEvent(ev);
266 } else if (event.is<TwoPlayerUnlinkEvent>()) {
267 auto& ev = event.as<TwoPlayerUnlinkEvent>();
268 this->handleUnlinkEvent(ev);
269 }
270}
271
272void TwoPlayerModule::handleLinkEvent(const TwoPlayerLinkRequestEvent& event) {
273 // are we already linked? if so, send an unlink if it's a different player (rejecting the link attempt)

Callers 1

TwoPlayerModuleMethod · 0.45

Calls 2

handleLinkEventMethod · 0.95
handleUnlinkEventMethod · 0.95

Tested by

no test coverage detected