blob: 0deefc2158896ff6c70bf1cf5d4de67bfa8f1adc (
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
#include "headers.h"
CSkinComplexObject::CSkinComplexObject(): m_children(5)
{
}
CSkinComplexObject::~CSkinComplexObject()
{
for (int i = 0; i < m_children.getCount(); ++i)
m_children[i]->Destroy();
m_children.destroy();
}
void CSkinComplexObject::LoadFromXml(HXML hXml)
{
CSkinObject::LoadFromXml(hXml);
int nChildren = xi.getChildCount(hXml);
for (int i = 0; i < nChildren; ++i)
{
HXML hChild = xi.getChild(hXml, i);
if (ISkinElement *obj = SkinCreateObjectFromXml(hChild, m_ds))
m_children.insert(obj, m_children.getCount());
}
}
bool CSkinComplexObject::IsComplexObject()
{
return true;
}
int CSkinComplexObject::GetChildCount()
{
return m_children.getCount();
}
ISkinElement *CSkinComplexObject::GetChild(int index)
{
return (index >= 0 && index < m_children.getCount()) ? m_children[index] : NULL;
}
bool CSkinComplexObject::AppendChild(ISkinElement *child)
{
m_children.insert(child, m_children.getCount());
child->SetParent(this);
return true;
}
bool CSkinComplexObject::InsertChild(ISkinElement *child, int index)
{
m_children.insert(child, index);
child->SetParent(this);
return true;
}
void CSkinComplexObject::RemoveChild(ISkinElement *child)
{
m_children.remove(child);
}
|