diff options
author | Tom Barrett <tombarrett@cornell.engr.siu.edu> | 2015-05-04 13:51:24 -0500 |
---|---|---|
committer | Tom Barrett <tombarrett@cornell.engr.siu.edu> | 2015-05-04 13:51:24 -0500 |
commit | afcf5f509a318ee66a16690f204f03dee701722e (patch) | |
tree | b3597c405f456d40c3de29392622803e55a3cfcd | |
parent | 72004f7f2eb558814b78630b25e23b968ac068ea (diff) |
process of implementing the unit list, have not compiled or tested
-rw-r--r-- | inc/creature.hpp | 3 | ||||
-rw-r--r-- | inc/list.hpp | 21 | ||||
-rw-r--r-- | inc/main.hpp | 1 | ||||
-rw-r--r-- | inc/window.hpp | 1 | ||||
-rw-r--r-- | src/creature.cpp | 4 | ||||
-rw-r--r-- | src/list.cpp | 7 | ||||
-rw-r--r-- | src/main.cpp | 13 |
7 files changed, 42 insertions, 8 deletions
diff --git a/inc/creature.hpp b/inc/creature.hpp index c0e80a7..ab4b328 100644 --- a/inc/creature.hpp +++ b/inc/creature.hpp @@ -8,7 +8,8 @@ class Creature: public Entity public: Creature(Window m, std::string s); void Behavior(); - void Action(); + void Action(); + private: int xT; int yT; diff --git a/inc/list.hpp b/inc/list.hpp new file mode 100644 index 0000000..6ae906d --- /dev/null +++ b/inc/list.hpp @@ -0,0 +1,21 @@ +#ifndef list_h +#define list_h + +#include "creature.hpp" +#include "resource.hpp" +#include "window.hpp" + +class List +{ + public: + List(Window m); + void Behavior(); + + private: + std::vector<Resource> R; + std::vector<Creature> C; + Window main; + int ** L; +}; + +#endif
\ No newline at end of file diff --git a/inc/main.hpp b/inc/main.hpp index cb67ab1..4360cf9 100644 --- a/inc/main.hpp +++ b/inc/main.hpp @@ -6,5 +6,6 @@ #include "event.hpp" #include "creature.hpp" #include "resource.hpp" +#include "list.hpp" #endif diff --git a/inc/window.hpp b/inc/window.hpp index d2dd801..b28da56 100644 --- a/inc/window.hpp +++ b/inc/window.hpp @@ -8,6 +8,7 @@ #include <stdlib.h> #include <time.h> #include <iostream> +#include <vector> class Window { diff --git a/src/creature.cpp b/src/creature.cpp index aeff472..c9f9fa0 100644 --- a/src/creature.cpp +++ b/src/creature.cpp @@ -16,8 +16,8 @@ void Creature::Behavior() //Priorities - //Action - this->Action(); + //Action + this->Action(); } void Creature::Action() diff --git a/src/list.cpp b/src/list.cpp new file mode 100644 index 0000000..e1695d6 --- /dev/null +++ b/src/list.cpp @@ -0,0 +1,7 @@ +#include "list.hpp" + +List::List(Window m) +{ + C.insert(Creature(m,"img/Cbasic.png")); + R.insert(Resource(m,"img/Rbasic.png")); +}
\ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp index de1351e..4435ad9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3,8 +3,9 @@ int main()
{
Window main;
- Creature testcreature(main, "img/Cbasic.png");
- Resource testresource(main, "img/Rbasic.png");
+ //Creature testcreature(main, "img/Cbasic.png");
+ //Resource testresource(main, "img/Rbasic.png");
+ List(main);
Event e;
while(e.gRun())
@@ -17,9 +18,11 @@ int main() // eventHandle(e.gEvent());
}
main.Clear();
- testcreature.Behavior();
- testcreature.Place();
- testresource.Place();
+
+ //testcreature.Behavior();
+ //testcreature.Place();
+ //testresource.Place();
+
main.Render();
SDL_Delay(10);
}
|