Class HitBotEvent

  • All Implemented Interfaces:
    IEvent

    public final class HitBotEvent
    extends BotEvent
    Event occurring when a bot has collided with another bot.
    • Constructor Summary

      Constructors 
      Constructor Description
      HitBotEvent​(int turnNumber, int victimId, double energy, double x, double y, boolean isRammed)
      Initializes a new instance of the BotHitBotEvent class.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double getEnergy()
      Returns the remaining energy level of the victim bot.
      int getVictimId()
      Returns the id of the other bot that your bot has collided with.
      double getX()
      Returns the X coordinate of victim bot.
      double getY()
      Returns the Y coordinate of victim bot.
      boolean isRammed()
      Checks if the other bot got rammed by your bot.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • HitBotEvent

        public HitBotEvent​(int turnNumber,
                           int victimId,
                           double energy,
                           double x,
                           double y,
                           boolean isRammed)
        Initializes a new instance of the BotHitBotEvent class.
        Parameters:
        turnNumber - is the turn number where the bot hit another bot.
        victimId - is the id of the other bot that your bot has collided with.
        energy - is the remaining energy level of the victim bot.
        x - is the X coordinate of victim bot.
        y - is the Y coordinate of victim bot.
        isRammed - is the flag specifying, if the victim bot got rammed.
    • Method Detail

      • getVictimId

        public int getVictimId()
        Returns the id of the other bot that your bot has collided with.
        Returns:
        The id of the other bot that your bot has collided with.
      • getEnergy

        public double getEnergy()
        Returns the remaining energy level of the victim bot.
        Returns:
        The remaining energy level of the victim bot.
      • getX

        public double getX()
        Returns the X coordinate of victim bot.
        Returns:
        The X coordinate of victim bot.
      • getY

        public double getY()
        Returns the Y coordinate of victim bot.
        Returns:
        The Y coordinate of victim bot.
      • isRammed

        public boolean isRammed()
        Checks if the other bot got rammed by your bot.
        Returns:
        true if the other bot got rammed; false otherwise.