diff options
author | majortom6 <tombarrett@siu.edu> | 2017-03-03 15:18:22 -0600 |
---|---|---|
committer | Tom Barrett <tombarrett@siu.edu> | 2017-03-07 13:23:42 -0600 |
commit | dfda3f2a5e555d3173359134f4994bcd12d129f8 (patch) | |
tree | adc9d75f1e28332b8c5208fdb3c4685667816dda /src/dna.cpp | |
parent | 3c78d411760beb9332e7282e4ec49a199998c67d (diff) |
-removed the Graphics Data class
-replaced with already implemented Rectangle, and put color and side variables in dna (can potentially remove the side variable if it does nothing important)
Diffstat (limited to 'src/dna.cpp')
-rw-r--r-- | src/dna.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/dna.cpp b/src/dna.cpp index 8cef6e0..ac2d500 100644 --- a/src/dna.cpp +++ b/src/dna.cpp @@ -14,6 +14,10 @@ DNA::DNA(std::string s) speed = CREATURE_SPEED; mutationPercent = CREATURE_MUTATION_PERCENT; mutationChance = CREATURE_MUTATION_CHANCE; + appearance.sides = CREATURE_SIDES; + appearance.red = 0; + appearance.green = 1; + appearance.blue = 1; } else if(s == "resource"){ type = RESOURCE_TYPE; @@ -27,6 +31,10 @@ DNA::DNA(std::string s) speed = 0; mutationPercent = 0; mutationChance = 0; + appearance.sides = RESOURCE_SIDES; + appearance.red = 0; + appearance.green = 1; + appearance.blue = 0; } } @@ -44,6 +52,10 @@ DNA DNA::combine(DNA D) N.speed = (speed + D.speed)/2; N.mutationPercent = (mutationPercent + D.mutationPercent)/2; N.mutationChance = (mutationChance + D.mutationChance)/2; + N.appearance.sides = CREATURE_SIDES; + N.appearance.red = 0; + N.appearance.green = 1; + N.appearance.blue = 1; if(roll(mutationChance)){ float pn; |