From 0dfbf40106d6a6c70d949e1f5bcfa1b33b20a68f Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Mon, 20 Jan 2014 01:59:04 +0000 Subject: member access permissions --- NT/src/rotor.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'NT/src/rotor.cpp') diff --git a/NT/src/rotor.cpp b/NT/src/rotor.cpp index 5225c02..1b75187 100644 --- a/NT/src/rotor.cpp +++ b/NT/src/rotor.cpp @@ -7,13 +7,18 @@ using namespace std; using namespace Rotor; +string Variable::get_connection_id(){ + if (connection) return connection->get_id(); + return ""; +} + template Json::Value Variable_type::to_json(){ Json::Value json; json["type"]=get_type(); json["name"]=name; json["connectable"]=connectable?"yes":"no"; - json["input"]=connection?connection->id:""; + json["input"]=connection?connection->get_id():""; return json; } @@ -25,7 +30,7 @@ Json::Value Variable_array_type::to_json(){ json["connectable"]=connectable?"yes":"no"; json["input"]=Json::arrayValue; for (auto& input: values) { - json["input"].append(input.connection?input.connection->id:""); + json["input"].append(input.is_connected()?input.get_connection_id():""); } return json; } @@ -42,7 +47,7 @@ Json::Value Node::to_json(){ node["type"]=type; node["type_id"]=type_id; node["title"]=title; - node["output_type"]=output_type(); + node["output_type"]=get_type(); node["description"]=description; node["id"]=id; node["ui_type"]=ui_type; -- cgit v1.2.3