src/Behaviour.h

00001 /*
00002 This file is part of Teapot Colony Wars.
00003 
00004 Teapot Colony Wars is free software: you can redistribute it and/or modify
00005 it under the terms of the GNU General Public License as published by
00006 the Free Software Foundation, either version 2 of the License, or
00007 (at your option) any later version.
00008 
00009 Teapot Colony Wars is distributed in the hope that it will be useful,
00010 but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 GNU General Public License for more details.
00013 
00014 You should have received a copy of the GNU General Public License
00015 along with Teapot Colony Wars.  If not, see <http://www.gnu.org/licenses/>.
00016 */
00017 
00018 #ifndef BEHAVIOUR_H
00019 #define BEHAVIOUR_H
00020 
00021 #include <list>
00022 
00023 #include "MoveCommand.h"
00024 
00025 class Worshiper;
00026 class Pheromone;
00027 class VisualContext;
00028 
00032 class Behaviour 
00033 {
00034 private:
00035 
00037   Worshiper const * _worshiper;
00038 
00045   Pheromone* getPheromoneColony(unsigned int i);
00046 
00047 protected:
00048 
00050   move_command _action;
00051 
00053   std::list<Pheromone*>* _pheros;
00054 
00058   Behaviour();
00059 
00065   move_command getLastAction() const;
00066 
00072   VisualContext* getVisualContext() const;
00073 
00079   unsigned int getSize() const;
00080 
00086   unsigned int getFood() const;
00087 
00093   unsigned int getCapacity() const;
00094 
00100   void putPheromone(unsigned int n);
00101 
00107   move_command randomMove() const;
00108 
00109 public:
00110 
00114   virtual ~Behaviour();
00115 
00119   void setWorshiper(const Worshiper* w);
00120 
00124   virtual void think() = 0;
00125 
00131   inline move_command getAction() { return _action; }
00132 
00138   inline std::list<Pheromone*>* getPheromones() { return _pheros; }
00139 
00140 };
00141 
00142 #endif // BEHAVIOUR_H

Generated on Sat Feb 2 22:22:54 2008 for Teapot Colony Wars by  doxygen 1.5.4