0.1.0: Test Branch and Various Small Refactorings
In this update, I mainly focused on creating a base for continuous integration. I decided not to include the gtest library and tests themselves in the master
branch to keep it lightweight. Instead, I created a tests
branch to house all the necessary code and used GitHub Actions to ensure CI is properly utilized. The test cases included do not provide full coverage, but they helped me spot a few bugs.
Changes
Bug Fixes:
NodeArea::Clear()
was not clearingGroupComments
.std::vector<Node*> Node::GetNodesConnectedToOutput()
was returning multiple copies of the same node if that node was connected through multiple sockets.
Breaking Changes:
- Renamed function
size_t Node::InputSocketCount
tosize_t Node::GetInputSocketCount
to better describe its functionality. - Renamed function
size_t Node::OutSocketCount
tosize_t Node::GetOutputSocketCount
to better describe its functionality. - Made
static void NodeArea::CopyNodesInternal
,static bool NodeArea::IsAlreadyConnected
, andstatic void NodeArea::ProcessConnections
functions private. - Renamed
static bool NodeArea::EmptyOrFilledByNulls
tostatic bool NodeArea::IsEmptyOrFilledByNulls
and made it private. - Renamed and moved
static bool NodeArea::IsNodeIDInList
tostatic bool Node::IsNodeWithIDInList
. - Transformed
static NodeArea* NodeArea::FromJson(std::string JsonText)
tovoid NodeArea::LoadFromJson(std::string JsonText)
to make it more clear when to use the function. This also helped to rewrite loading from a file to avoid node copying, as the previous implementation was inefficient due to legacy issues. - Renamed
NodeArea::SetNodeEventCallback
toNodeArea::AddNodeEventCallback
to better reflect its functionality and shifted from accepting raw function pointers to acceptingstd::function
for better support of lambdas.
Other Changes:
- Added
size_t NodeArea::GetGroupCommentCount
function. - Changed the return type of the
NodeArea::GetNodeCount
function fromint
tosize_t
. - Added
bool Node::CouldBeDestroyed
function. - Added
Node* NodeArea::GetNodeByID
function. - Added
GroupComment* NodeArea::GetGroupCommentByID(std::string GroupCommentID)
andstd::vector<GroupComment*> NodeArea::GetGroupCommentsByName(std::string GroupCommentName)
functions. - Added
std::vector<Node*> NodeArea::GetNodesInGroupComment(GroupComment* GroupCommentToCheck)
,std::vector<RerouteNode*> NodeArea::GetRerouteNodesInGroupComment(GroupComment* GroupCommentToCheck)
, andstd::vector<GroupComment*> NodeArea::GetGroupCommentsInGroupComment(GroupComment* GroupCommentToCheck)
functions. - Added
bool NodeArea::TryToDisconnect(const Node* OutNode, size_t OutNodeSocketIndex, const Node* InNode, size_t InNodeSocketIndex)
,bool NodeArea::TryToDisconnect(const Node* OutNode, std::string OutSocketID, const Node* InNode, std::string InSocketID)
,bool NodeArea::IsConnected(const Node* OutNode, size_t OutNodeSocketIndex, const Node* InNode, size_t InNodeSocketIndex)
, andbool NodeArea::IsConnected(const Node* OutNode, std::string OutSocketID, const Node* InNode, std::string InSocketID)
functions to improve work with connections.