#include "TouchSensor.h" namespace RoboidControl { // TouchSensor::TouchSensor() : Thing(Thing::Type::TouchSensor) {} // TouchSensor::TouchSensor(Participant* owner, unsigned char thingId) // : Thing(owner, Thing::Type::TouchSensor, thingId) {} // TouchSensor::TouchSensor(Thing* parent, unsigned char thingId) : // Thing(parent->owner, Thing::Type::TouchSensor, thingId) { // this->SetParent(parent); // } TouchSensor::TouchSensor(Participant* owner) : Thing(owner, Type::TouchSensor) {} TouchSensor::TouchSensor(Thing* parent) : Thing(parent, Type::TouchSensor) {} int TouchSensor::GenerateBinary(char* bytes, unsigned char* ix) { bytes[(*ix)++] = touchedSomething ? 1 : 0; return 1; } void TouchSensor::ProcessBinary(char* bytes) { this->touchedSomething |= (bytes[0] == 1); } } // namespace RoboidControl