From 03885192b9ff7d3c5e2dcfd98aefd21e9b62f603 Mon Sep 17 00:00:00 2001 From: majortom6 Date: Sat, 18 Feb 2017 09:28:58 -0600 Subject: general refractoring --- inc/creature.hpp | 2 +- inc/entity.hpp | 26 +++++++++++++------------- inc/main.hpp | 3 --- inc/resource.hpp | 2 +- inc/window.hpp | 1 - 5 files changed, 15 insertions(+), 19 deletions(-) (limited to 'inc') diff --git a/inc/creature.hpp b/inc/creature.hpp index 56954fe..67617c6 100644 --- a/inc/creature.hpp +++ b/inc/creature.hpp @@ -19,7 +19,7 @@ class Creature: public Entity void Priority(); void setTarget(); void checkTarget(); - void Move(SDL_Rect R); + void moveTowards(SDL_Rect R); void impregnate(Dna D); void giveN(std::vector n){N = n;}; diff --git a/inc/entity.hpp b/inc/entity.hpp index 0eb8f60..1bb0405 100644 --- a/inc/entity.hpp +++ b/inc/entity.hpp @@ -7,22 +7,22 @@ class Entity { public: - void Place(); - - int getType(){return type;}; - SDL_Rect getRect(){return rect;}; + void Place(); + + int getType(){return type;}; + virtual bool getGender(void){}; + virtual int getAmount(void){}; + SDL_Rect getRect(){return rect;}; - virtual void eat(int bite){}; - virtual void impregnate(Dna D){}; - virtual bool getGender(void){}; - virtual int getAmount(void){}; + virtual void eat(int bite){}; + virtual void impregnate(Dna D){}; protected: - int type; - int gender; - bool pregnate; - SDL_Rect rect; - SDL_Renderer* renderer; + int type; + int gender; + bool pregnate; + SDL_Rect rect; + SDL_Renderer* renderer; }; #endif diff --git a/inc/main.hpp b/inc/main.hpp index 82a78c8..9dc5dcf 100644 --- a/inc/main.hpp +++ b/inc/main.hpp @@ -2,10 +2,7 @@ #define main_h #include "window.hpp" -#include "entity.hpp" #include "event.hpp" -#include "creature.hpp" -#include "resource.hpp" #include "list.hpp" #include "timer.hpp" diff --git a/inc/resource.hpp b/inc/resource.hpp index cb5946c..89f6c45 100644 --- a/inc/resource.hpp +++ b/inc/resource.hpp @@ -7,7 +7,7 @@ class Resource: public Entity { public: - Resource(Window m, SDL_Rect Rect); + Resource(Window m, SDL_Rect R); int getAmount(){return amount;}; void grow(); void eat(int bite); diff --git a/inc/window.hpp b/inc/window.hpp index 8ce53db..d801972 100644 --- a/inc/window.hpp +++ b/inc/window.hpp @@ -2,7 +2,6 @@ #define window_h #include -#include #include #include "constants.hpp" -- cgit v1.2.3