summaryrefslogtreecommitdiff
path: root/src/SSystem/SComponent/c_tree.cpp
blob: 7b51f874f0f9c0dfb728cc267a0cfcd5e6f17f59 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/**
 * c_tree.cpp
 *
 */

#include "SSystem/SComponent/c_tree.h"
#include "SSystem/SComponent/c_list.h"

int cTr_SingleCut(node_class* node) {
    return cLs_SingleCut(node);
}

int cTr_Addition(node_lists_tree_class* tree, int listIdx, node_class* node) {
    if (listIdx >= tree->mNumLists)
        return 0;

    return cLs_Addition(&tree->mpLists[listIdx], node);
}

int cTr_Insert(node_lists_tree_class* tree, int listIdx, node_class* node, int idx) {
    if (listIdx >= tree->mNumLists)
        return 0;

    return cLs_Insert(&tree->mpLists[listIdx], idx, node);
}

void cTr_Create(node_lists_tree_class* tree, node_list_class* lists, int numLists) {
    tree->mpLists = lists;
    tree->mNumLists = numLists;

    while (numLists-- > 0)
        cLs_Create(lists++);
}