-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfactory.cpp
More file actions
43 lines (38 loc) · 778 Bytes
/
factory.cpp
File metadata and controls
43 lines (38 loc) · 778 Bytes
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
#include "factory.h"
Factory::Factory()
{
data = new GameData();
logic = new GameController();
v1 = new GameOutput*[NBROV];
for (int i=0; i<NBROV; i++)
{
QString t;
t.sprintf("Outputview #%d",i);
v1[i] = new GameOutput(100+i*50,100+i*50,500,500,t);
}
v2 = new GameInput(100,450,400,300,"Command Window");
}
Factory::~Factory()
{
delete data;
delete logic;
for (int i=0; i<NBROV; i++)
{
delete v1[i];
}
delete[] v1;
delete v2;
}
void Factory::build()
{
logic->initRelations(data);
for (int i=0; i<NBROV; i++)
{
v1[i]->initRelations(data, logic);
}
v2->initRelations(data, logic);
for (int i=0; i<NBROV; i++)
{
data->subscribe(v1[i]);
}
}