#include "CoreThing.h" CoreThing::CoreThing( // Participant *client, unsigned char networkId, unsigned char thingId, unsigned char thingType) { // this->client = client; this->id = thingId; this->type = thingType; this->networkId = networkId; this->Init(); // CoreThings::Add(this); } void CoreThing::Init() {} // CoreThing *CoreThings::allThings[256] = {nullptr}; // CoreThing *CoreThings::Get(unsigned char networkId, unsigned char thingId) { // for (unsigned char ix = 0; ix < 256; ix++) { // CoreThing *thing = allThings[ix]; // if (thing == nullptr) // continue; // if (thing->networkId == networkId && thing->id == thingId) // return thing; // } // return nullptr; // } // bool CoreThings::Add(CoreThing *newThing) { // for (unsigned char ix = 0; ix < 256; ix++) { // CoreThing *thing = allThings[ix]; // if (thing == nullptr) { // allThings[ix] = newThing; // return true; // } // } // return false; // }