summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Barrett <tombarrett@siu.edu>2017-03-17 01:51:54 -0500
committerTom Barrett <tombarrett@siu.edu>2017-03-17 01:51:54 -0500
commit3b3df333974f337fcb506f37a06ea0e89c14b4b0 (patch)
treea73b1e209c0cecce9161c26caace4298f4aafc48
parentc86eef1db053a51748cf75a8318604b1d14b5be5 (diff)
-fixed type init
-rw-r--r--inc/dna.hpp2
-rw-r--r--src/dna.cpp10
2 files changed, 6 insertions, 6 deletions
diff --git a/inc/dna.hpp b/inc/dna.hpp
index ff252a8..8bd9ab2 100644
--- a/inc/dna.hpp
+++ b/inc/dna.hpp
@@ -10,7 +10,7 @@ class DNA
{
public:
DNA(){};
- DNA(int type);
+ DNA(int t);
DNA combine(DNA D);
diff --git a/src/dna.cpp b/src/dna.cpp
index 1c70f46..47c66e9 100644
--- a/src/dna.cpp
+++ b/src/dna.cpp
@@ -1,8 +1,8 @@
#include "dna.hpp"
-DNA::DNA(int type)
+DNA::DNA(int t)
{
- if(type == HERBAVORE_TYPE){
+ if(t == HERBAVORE_TYPE){
type = HERBAVORE_TYPE;
eatType = PLANT_TYPE;
maxHealth = CREATURE_MAX_HEALTH;
@@ -20,7 +20,7 @@ DNA::DNA(int type)
appearance.green = 1;
appearance.blue = 1;
}
- else if(type == CARNIVORE_TYPE){
+ else if(t == CARNIVORE_TYPE){
type = CARNIVORE_TYPE;
eatType = HERBAVORE_TYPE;
maxHealth = CREATURE_MAX_HEALTH;
@@ -38,7 +38,7 @@ DNA::DNA(int type)
appearance.green = 0;
appearance.blue = 1;
}
- else if(type == PLANT_TYPE){
+ else if(t == PLANT_TYPE){
type = PLANT_TYPE;
maxHealth = PLANT_MAX_HEALTH;
growAmount = PLANT_GROW_AMOUNT;
@@ -46,7 +46,7 @@ DNA::DNA(int type)
appearance.green = 1;
appearance.blue = 0;
}
- else if(type == CORPSE_TYPE){
+ else if(t == CORPSE_TYPE){
type = CORPSE_TYPE;
maxHealth = CORPSE_MAX_HEALTH;
growAmount = CORPSE_DECAY_AMOUNT;