mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2025-12-21 14:50:26 -08:00
24 lines
499 B
C++
24 lines
499 B
C++
#include "abstract_deck_list_node.h"
|
|
|
|
#include "inner_deck_list_node.h"
|
|
|
|
AbstractDecklistNode::AbstractDecklistNode(InnerDecklistNode *_parent, int position)
|
|
: parent(_parent), sortMethod(Default)
|
|
{
|
|
if (parent) {
|
|
if (position == -1) {
|
|
parent->append(this);
|
|
} else {
|
|
parent->insert(position, this);
|
|
}
|
|
}
|
|
}
|
|
|
|
int AbstractDecklistNode::depth() const
|
|
{
|
|
if (parent) {
|
|
return parent->depth() + 1;
|
|
} else {
|
|
return 0;
|
|
}
|
|
} |