

/**
    Something that an {@link Asset} is aimed at.

    @author RPD
*/
public class Target {
    private String Tid;
    private int Ttype;
    private LatLong Tmaploc;
    private ScreenLoc Tsloc;
    //private int Tx;
    //private int Ty;
    private String TTtype;
    int ArrayPos;
    private double Importance;	// how important is hitting this target?

    public void SetArrayPos(int i) {
        ArrayPos=i;
    }
    public int GetArrayPos() {
        return ArrayPos;
    }
    public double GetImportance() {
        return Importance;
    }
    public LatLong GetLatLong() {
        return Tmaploc;
    }
    public String GetTType() {
        return TTtype;
    }
    public ScreenLoc GetScreenLoc() {
        return Tsloc;
    }
    
    /* Returns description
     * @author Nick Cole
     */
    public String GetTID() {
        return Tid;
    }

    // TargetMap is passed since we need a coordinate system to store the screen
    // coords of the target with the target when we create it 
    public Target(String tid, LatLong tloc, String ttype, StrikeMap TargetMap, double importance) {
        Tid=tid;
        Tmaploc=tloc;
        TTtype=ttype;
        Importance=importance;
        ArrayPos=-1;
        if(TargetMap!=null) Tsloc=TargetMap.MapToScreenCoords(tloc);
        else Tsloc = null;

       //System.err.println("CREATED Target with Tsloc "+Tsloc);
    }

    public String toString() {
        if(Tsloc==null)
            return new String(Tid);
        else
            return new String("Target: "+Tid+ " at " + Tmaploc);
    }

}
