Skip to content

Commit 0e35ac0

Browse files
committed
Move some dummy_nodes definitions to cpp file to fix linker error
1 parent 83caef7 commit 0e35ac0

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

sample_nodes/dummy_nodes.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,16 @@ BT::NodeStatus SaySomethingSimple(BT::TreeNode &self)
7272
return BT::NodeStatus::SUCCESS;
7373
}
7474

75+
void to_json(nlohmann::json& j, const Vector3& p)
76+
{
77+
j = nlohmann::json{{"x", p.x}, {"y", p.y}, {"z", p.z}};
78+
}
79+
80+
void from_json(const nlohmann::json& j, Vector3& p)
81+
{
82+
j.at("x").get_to(p.x);
83+
j.at("y").get_to(p.y);
84+
j.at("z").get_to(p.z);
85+
}
86+
7587
}

sample_nodes/dummy_nodes.h

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -129,17 +129,9 @@ struct Vector3
129129
float z;
130130
};
131131

132-
void to_json(nlohmann::json& j, const Vector3& p)
133-
{
134-
j = nlohmann::json{{"x", p.x}, {"y", p.y}, {"z", p.z}};
135-
}
132+
void to_json(nlohmann::json& j, const Vector3& p);
136133

137-
void from_json(const nlohmann::json& j, Vector3& p)
138-
{
139-
j.at("x").get_to(p.x);
140-
j.at("y").get_to(p.y);
141-
j.at("z").get_to(p.z);
142-
}
134+
void from_json(const nlohmann::json& j, Vector3& p);
143135

144136
class RandomVector : public BT::SyncActionNode
145137
{

0 commit comments

Comments
 (0)