From dfda3f2a5e555d3173359134f4994bcd12d129f8 Mon Sep 17 00:00:00 2001 From: majortom6 Date: Fri, 3 Mar 2017 15:18:22 -0600 Subject: -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) --- src/dna.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/dna.cpp') 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; -- cgit v1.2.3