-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBlocklist.cpp
47 lines (39 loc) · 924 Bytes
/
Blocklist.cpp
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
#include "Blocklist.h"
// Constructeurs
Cblocklist::Cblocklist()
{
// rien à faire
}
Cblocklist::Cblocklist(Cblock const& e_block)
{
m_blocklist.push_back(new Cblock(e_block));
}
// Constructeur par copie
Cblocklist::Cblocklist(Cblocklist const& e_blocklist) :
m_blocklist(e_blocklist.m_blocklist)
{
// rien à faire
}
// Surgarges d'opérateur
Cblock* Cblocklist::operator[] (unsigned int x)
{
return m_blocklist[x];
}
// Methodes
Cblock Cblocklist::GetBlock(unsigned int x)
{
return *m_blocklist[x];
}
void Cblocklist::addBlock(Cblock const& e_block)
{
m_blocklist.push_back(new Cblock(e_block));
}
void Cblocklist::addBlock(string e_name, string e_description, bool e_grassy)
{
unsigned int index = m_blocklist.size();
m_blocklist.push_back(new Cblock(index, e_name, e_description, e_grassy));
}
unsigned int Cblocklist::getBlocklistSize()
{
return m_blocklist.size();
}