tom dunigan
/
antsnbugs
stochastic simulation, predator/prey
Diff: Ant.h
- Revision:
- 0:fc1335b7b54f
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Ant.h Mon Dec 23 18:56:56 2019 +0000 @@ -0,0 +1,44 @@ +// +// Ant.h +// INHERITANCE_AND_POLYMORPHISM +// +// Created by Kristjan Thorsteinsson on 01/04/14. +// Copyright (c) 2014 Kristjan Thorsteinsson. All rights reserved. +// + +#ifndef INHERITANCE_AND_POLYMORPHISM_Ant +#define INHERITANCE_AND_POLYMORPHISM_Ant + +//#include <iostream> +#include "Organism.h" +#include "World.h" +#include "Counter.h" + +class Ant : public Organism, public counter<Ant> +{ +public: + + Ant(World* aWorld, int xcoord, int ycoord); + // In the given world moves this organism. + void move(); + + // Makes this organism breed. + void breed(); + + // Returns the type of this organism. + OrganismType getType() const; + + // The character representation of this organism. + char representation() const; + + // The size of this organism. + int size() const; + + bool in_range(int xx, int yy); + +private: + + void generateOffspring(int whereX, int whereY); +}; + +#endif /* defined(__INHERITANCE_AND_POLYMORPHISM__Ant__) */