public Unit(string name, Coords coords, int team) { this.name= name; this.position = coords; this.team = team; this.maxSlope = 1; }
public void MoveTo(Coords loc, double Rotation) { position = loc; rotation = Rotation; }
public void MoveTo(int X, int Y, int Z, double Rotation) { position = new Coords(X,Y,Z); rotation = Rotation; }
public Effect(Coords start, Coords delta, Texture tex) { }
public double Direction(Coords Before) { //ignores y; return Math.Atan2( this.Z - Before.Z,this.X- Before.X); }
public bool InRange(Coords origin, Coords target) { bool inRange = false; switch(this.Type){ case WeaponType.PROJECILE: //TODO LINE OF SIGHT case WeaponType.MELEE: case WeaponType.MAGIC: inRange = Math.Abs(target.X- origin.X) <=1 && Math.Abs(target.Y- origin.Y) <=1 && Math.Abs(target.Z- origin.Z) <=1; break; case WeaponType.ORBITAL: inRange =true; break; } return inRange; }
public Effect(Coords start, Texture texture, int howLong) { position = start; maxTime=howLong; }