import java.awt.Point;

public class Mobile   {
  private long numero ;
  String nom ;
  int x, y , vX , vY , gX , gY ; 
  private static int Numero_courant = 0 ;
  static final String default_name = "" ;

  Mobile() {
    numero = Numero_courant++ ;
    nom = default_name ;
    x = y = vX = vY = gX = gY = 0 ;
  }

  Mobile(int x, int y) {
    this() ;
    this.x = x;
    this.y = y ;
  }

  Mobile (String nom) {
    this () ; // invocation de Mobile()
    this.nom = nom ;
  }

  Mobile(Point P) {
    this(P.x,P.y);
  }

  Mobile(Point P, String nom) {
    this(P);
    this.nom = nom ;
    /* this(nom) ; impossible car une seule fois et la premiere */
  }

  public Point getPosition () {
    return new Point(x,y) ;  // pour cloner !!
  }
  
  public int getX () {
    return x;
  }

  public int getY () {
    return y;
  }

  public int getVX () {
    return vX ;
  }
  public int getVY () {
    return vY ;
  }
  public int getGX () {
    return gX ;
  }
  public int getGY () {
    return gY ;
  }
  
  public String getName() {
    return nom;
  }
  
  public void setG(int gX,int gY) {
    this.gX = gX ;
    this.gY = gY ;
  }
  
    public boolean  move() {
	x += vX ;
	y += vY ;
	vX += gX ;
	vY += gY ;
	return false;
    }

  public boolean move (int delta_t) {
    for(int t = 0 ; t < delta_t ; t ++) 
      {
        move();
      }
    return false;
  }
  
  
  
  public String toString() {
    String answer;
    if (this.nom.equals(default_name)) 
      answer = "[No:" +  numero ;
    else
      answer= this.nom;
    answer = answer + " en (" + x + "," + y+ ") ]" ;
    return answer ;
  }
  
  
  public static void main(String[] args) {
    Point p= new Point(10,3);
    Mobile m0 = new Mobile(p,"toto");
    m0.setG(2,5);
    System.out.println(m0);
    m0.move();
    System.out.println(m0);
    m0.move();
    System.out.println(m0);
    m0.move();
    System.out.println(m0);
  }
}