forked from CostardRouge/Cuby
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathASection.cpp
More file actions
84 lines (70 loc) · 1.29 KB
/
Copy pathASection.cpp
File metadata and controls
84 lines (70 loc) · 1.29 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#include "ASection.hpp"
ASection::ASection(eSection _ASection, Ressources *_ressources)
{
this->section = _ASection;
this->ressources = _ressources;
}
ASection::~ASection()
{
std::list<AObject *>::iterator it;
this->DeleteObjects();
}
// Members functions
void ASection::AddObject(AObject *item)
{
this->objects.push_back(item);
}
void ASection::AddObjects(std::list<AObject *> & items)
{
std::list<AObject *>::iterator it;
it = items.begin();
while (it != items.end())
{
this->objects.push_back(*it);
it++;
}
}
void ASection::DeleteObjects(void)
{
std::list<AObject *>::iterator it;
it = this->objects.begin();
while (it != this->objects.end())
{
delete (*it);
it++;
}
}
void ASection::ClearObjects(void)
{
this->objects.clear();
}
void ASection::DrawObjects(void)
{
std::list<AObject *>::iterator it;
it = this->objects.begin();
while (it != this->objects.end())
{
(*it)->Draw();
it++;
}
}
void ASection::UpdateObjects(void)
{
std::list<AObject *>::iterator it;
it = this->objects.begin();
while (it != this->objects.end())
{
(*it)->Update();
it++;
}
}
// Getters
eSection ASection::getSection(void) const
{
return (this->section);
}
// Setters
void ASection::setSection(eSection value)
{
this->section = value;
}