/* Copyright (C) 2006 Bradley Arsenault This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef AIEcho_h #define AIEcho_h #include namespace AIEcho { struct position { position(int x, int y); int x; int y; }; namespace Gradients { namespace Entities { class Entity { public: virtual bool operator()(Map* map, int posx, int posy); }; class Building : public Entity { public: Building(int building_type, int team); bool operator()(Map* map, int posx, int posy); }; class AnyTeamBuilding : public Entity { public: AnyTeamBuilding(int team); bool operator()(Map* map, int posx, int posy); }; class AnyBuilding : public Entity { public: AnyBuilding(); bool operator()(Map* map, int posx, int posy); }; class Ressource : public Entity { public: Ressource(int ressource_type); bool operator()(Map* map, int posx, int posy); }; class AnyRessource : public Entity { public: AnyRessource(); bool operator()(Map* map, int posx, int posy); }; class Water : public Entity { public: Water(); bool operator()(Map* map, int posx, int posy); }; }; class GradientInfo { public: GradientInfo(); void add_source(Entities::Entity* source); void add_obstacle(Entities::Entity* obstacle); }; class Gradient { public: Gradient(const GradientInfo& gi); void recalculate(Map* map); int get_height(int posx, int posy); }; class GradientManager { public: GradientManager(); Gradient& get_gradient(const GradientInfo& gi); void update(); }; }; namespace Construction { class Constraint { public: Constraint(); }; class MinimumDistance : public Constraint { public: MinimumDistance(const GradientInfo& gi, int distance); }; class MaximumDistance: public Constraint { public: MaximumDistance(const GradientInfo& gi, int distance); }; class MinimizedDistance : public Constraint { public: MinimizedDistance(const GradientInfo& gi, int weight); }; class MaximizedDistance : public Constraint { public: MaximizedDistance(const GradientInfo& gi, int weight); }; class BuildingOrder { public: BuildingOrder(int building_type, int number_of_workers); void add_constraint(const Constraint& constraint); position find_location(GradientManager& manager); }; }; class Echo { public: Echo(); void add_building_order(BuildingOrder& bo); }; }; #endif