#pragma once
#include "PrimitiveLocation.h"

class Map;

/**
 * @brief Primitive location consisting of 32x32 pixels (same dimensions as BWAPI::TilePosition).
 */
class Tile : public PrimitiveLocation
{
public:
  Tile()
  {
  }

  virtual BWAPI::Position getCurrentCenter() const;

  virtual bool isInLocation(BWAPI::Position pos) const;
  virtual bool isInLocation(BWAPI::TilePosition tile) const;

  virtual std::pair<BWAPI::TilePosition, int> getOldestVisibleTile() const;

  virtual BWAPI::TilePosition getRandomTile() const;

  operator BWAPI::TilePosition() const
  {
    return BWAPI::TilePosition(m_x, m_y);
  }

protected:
  friend class Map;

  virtual void _output(std::ostream& out) const
  {
    out << "Tile(" << m_x << "," << m_y << ")";
  }

  void setXY(int x, int y)
  {
    m_x = x;
    m_y = y;
  }

  int m_x;
  int m_y;
};
