Skip to content
Snippets Groups Projects
EnemyRobotStatus.java 2.91 KiB
Newer Older
Martin Vítek's avatar
Martin Vítek committed
/*
 * ----------------------------------------------------------------------------------
 * "THE BEER-WARE LICENSE" (Revision 42):
 * <martinv@students.zcu.cz> wrote this file.  As long as you retain this notice you
 * can do whatever you want with this stuff. If we meet some day, and you think
 * this stuff is worth it, you can buy me a beer in return.   Martin Vítek
 * ----------------------------------------------------------------------------------
Martin Vítek's avatar
Martin Vítek committed
 */
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.getEnergy();
Martin Vítek's avatar
Martin Vítek committed
        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;
    }
}