#include "Circle.hh"

Circle::Circle():mobile2d(){
  shape=std::make_shared<sf::CircleShape>(sf::CircleShape(10));
  shape->setPosition(900,700);
}
Circle::Circle(prologparse * plparse):mobile2d(plparse){
  shape=std::make_shared<sf::CircleShape>(sf::CircleShape(10));
  shape->setPosition(900,700);
}
Circle::Circle(int x,int y):mobile2d(){
  shape=std::make_shared<sf::CircleShape>(sf::CircleShape(10));
  shape->setPosition(x,y);
}
Circle::Circle(prologparse * plparse,int x, int y):mobile2d(plparse){
  shape=std::make_shared<sf::CircleShape>(sf::CircleShape(10));
  shape->setPosition(x,y);
}
double Circle::x(){
  return shape->getPosition().x;
}
double Circle::y(){
  return shape->getPosition().y;
}
double Circle::limLeft() {
  return x() /*- shape->getRadius()*/;
}
double Circle::limRight() {
  return x() + getDiameter();
}
double Circle::limUp() {
  return y() /*- shape->getRadius()*/;
}
double Circle::limDown() {
  return y() + getDiameter();
}
void Circle::moveLeft(){
  shape->move(-1, 0);
}
void Circle::moveRight(){
  shape->move(1, 0);
}
void Circle::moveUp(){
  shape->move(0, -1);
}
void Circle::moveDown(){
  shape->move(0, 1);
}
double Circle::getDiameter(){
  std::shared_ptr<sf::CircleShape> circle=std::dynamic_pointer_cast<sf::CircleShape>(shape);  
  return circle->getRadius()*2.f;
}