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 |
#pragma once
#include "GameEngine.h"
class IntLijst
{
friend tstringstream& operator<<(tstringstream& stream, IntLijst& lijst);
friend tstring operator+(tstring string, IntLijst& lijst);
public:
IntLijst();
virtual ~IntLijst();
// Voeg toe aan het einde van de lijst
void push_back(int value);
// Verwijder van het einde van de lijst en geef de waarde terug
int pop_back();
// Geef het element op die positie terug
int at(int positie) const;
// Voeg toe op die positie en schuif alle volgende elementen op
void insert(int value, int positie);
// Verander de waarde op deze positie
void change(int positie, int newvalue);
// Geef het aantal items terug
int getLength() const;
static const int BASE_SIZE=10;
IntLijst(const IntLijst& p);
IntLijst& operator=(const IntLijst& p);
IntLijst operator+(const IntLijst& p);
IntLijst& operator+=(const IntLijst& p);
bool operator==(const IntLijst& p);
bool operator!=(const IntLijst& p);
void operator>>(tstringstream &p);
int& operator[] (int index);
private:
void vergrootArray();
int *m_DynArrPtr;
int m_AantalElementen,m_Capaciteit;
};
|