// © Copyright1995, Joseph Bergin.  All rights reserved. 

#ifndef __Ant__
#define __Ant__

#include "Array.h"
#include "Boolean.h"

enum direction{North, East, South, West};

class Food;

class Ant
{	public:
		Ant(int h = 0, int v = 0, direction d = North);
//		Ant(const Ant &a);
//		~Ant();
//		Ant& operator= (const Ant& a);
		
		void move(void);
		void turnLeft(void);
		void mark();
		void eat(Food &f);
	protected:
		int _horiz;
		int _vert;
		direction _direction;
	friend class World;
};

class Food
{	public:
		Food(){_quantity = 0;};
		void eaten();
	private:
		Food(int h , int v , int amount = 1);
		int _horiz;
		int _vert;
		int _quantity;
	friend class World;
};

class World
{	public:
		World(int amountO_food = 10);
		World(const World & w);
		~World(void);
		World & operator = (const World & w);
		Boolean foodAt(Ant &a); // yes or no
		Food &getFood(Ant &a); 
		void dump();
	private:
		Array<Food*> _food;
		unsigned int _howMuch;
		Boolean foodAt(int h, int v); // yes or no
		Food &getFood(int h, int v); 
};

#endif

/*
  Add a food cell class.  Permit food to be distributed. Each food cell 
  should know its own location. Create a special set-like structure to 	
  hold all of the food cells. It should be able to respond to a query of 
  the form "Is there food at (h,v)?" where h and v give coordinates. 
  
  Give ants energy levels. Energy goes down as the ant moves.
  Energy goes up as the ant eats. Give ants an eat method that is an error
  if there is no food on current position.  Give ants a method:
  
  	int Ant::nextToFood();
  	
  that determines if there is food on current position. 
*/
