/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package cz.zcu.martinv.MyRobocodeRobots; import java.util.Objects; import robocode.ScannedRobotEvent; /** * * @author martin.vitek */ public class EnemyRobotStatus { private String name; private double bearing; private double distance; private double energy; private double heading; private double velocity; /** * * @param name * @param bearing * @param distance * @param energy * @param heading * @param velocity */ public EnemyRobotStatus(String name, double bearing, double distance, double energy, double heading, double velocity) { this.name = name; this.bearing = bearing; this.distance = distance; this.energy = energy; this.heading = heading; this.velocity = velocity; } public EnemyRobotStatus(ScannedRobotEvent e) { this.name = e.getName(); this.bearing = e.getBearing(); this.distance = e.getDistance(); this.energy = e.getDistance(); this.heading = e.getHeading(); this.velocity = e.getVelocity(); } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final EnemyRobotStatus other = (EnemyRobotStatus) obj; if (!Objects.equals(this.name, other.name)) { return false; } return true; } public String getName() { return name; } public void setName(String name) { this.name = name; } public double getBearing() { return bearing; } public void setBearing(double bearing) { this.bearing = bearing; } public double getDistance() { return distance; } public void setDistance(double distance) { this.distance = distance; } public double getEnergy() { return energy; } public void setEnergy(double energy) { this.energy = energy; } public double getHeading() { return heading; } public void setHeading(double heading) { this.heading = heading; } public double getVelocity() { return velocity; } public void setVelocity(double velocity) { this.velocity = velocity; } }