blob: ed09c5a77b6ee2147eef7113d768fd2f95eb3e1c (
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
|
#include "List.hpp"
List::List()
{
for(int i = 0; i < 10; i++)
{
Location L;
L.x = 150;
L.y = 150+i;
Character x ('@',4,L);
men.push_back(x);
occupied.push_back(x.getLocation());
}
}
void List::draw(WINDOW * w)
{
for(int i = 0; i < 10; i++)
men[i].draw(w);
}
void List::action()
{
for(int i = 0; i < 10; i++)
{
Location L = men[i].action(occupied);
if (L.x != 0 && L.y != 0)
occupied[i]=L;
}
}
|