#include "clue_data.h" #include "core/config/engine.h" #include "you_done_it/macros.h" #include "you_done_it/ydi_client.h" void ClueData::_bind_methods() { BIND_HPROPERTY(Variant::INT, id, PROPERTY_HINT_ENUM, NetworkData::ClueID_hint()); } void ClueData::set_revealed(bool value) { this->revealed = value; } void ClueData::set_id(NetworkData::ClueID id) { this->id = id; } NetworkData::ClueID ClueData::get_id() const { return this->id; } void ClueData::reveal() { if (this->id == NetworkData::CLUE_MAX) { print_error("Attempt to reveal CLUE_MAX, invalid state, aborting"); abort(); } if (this->revealed) { print_error("Attempt to reveal clue that's already revealed, returning without action"); return; } this->revealed = true; if (ydi::client::status() == NetworkData::CONNECTION_AUTHENTICATED) { ydi::client::send::reveal_clue(this->id); } } bool ClueData::get_revealed() const { return this->revealed; } void ClueData::set_image(Ref image) { this->image = image; // TODO: Sync to server } Ref ClueData::get_image() const { return this->image; }