[dreambol] basic class for Position Calculation

  • From: Arjen van der Ploeg <arjen@xxxxxxxxxxxxxxxx>
  • To: dreambol@xxxxxxxxxxxxx
  • Date: Mon, 05 Oct 2009 13:30:08 +0200

Hi Kasim,

hier mal nen ersten Grundgerüst der Klasse PositionCalculatuion.

Gruss Arjen
class PositionCalculation {
private double x,y,z,r;
public PositionCalculation(double x, double y, double z, double r) // create 
the Charakter
{
        this.x = x;
        this.y = y;
        this.z = z;
        this.r = r;     
}
public void setPosition(double x, double y, double z) // set Charakter Position
{
        this.x = x;
        this.y = y;
        this.z = z;
}
public void moveCharakter(double x, double y, double z) // TODO: handle 
collision exception
{
        this.x = x;
        this.y = y;
        this.z = z;
}
public double[] getPosition() // answer with an array containing the position 
information in x,y,z,r
{
        double[] position = new double[]{this.x, this.y, this.z, this.r};
        return position;
}
}

Other related posts: