diff options
Diffstat (limited to 'src/List.cpp')
-rw-r--r-- | src/List.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/List.cpp b/src/List.cpp index 94506f4..ed09c5a 100644 --- a/src/List.cpp +++ b/src/List.cpp @@ -4,7 +4,10 @@ List::List() { for(int i = 0; i < 10; i++) { - Character x ('@',4,150,150+i); + Location L; + L.x = 150; + L.y = 150+i; + Character x ('@',4,L); men.push_back(x); occupied.push_back(x.getLocation()); } @@ -19,9 +22,9 @@ void List::draw(WINDOW * w) void List::action() { for(int i = 0; i < 10; i++) - if(men[i].action(occupied)) - { - //rows[i] = 0; - //cols[i] = 0; - } + { + Location L = men[i].action(occupied); + if (L.x != 0 && L.y != 0) + occupied[i]=L; + } } |