Sie sind auf Seite 1von 32

TRADUCIDO POR R_CR_TE

/* C:\robocode\javadoc\index.html */ Traducido de : -> IBasicEvents Interface IBasicEvents

Method Summary

Resumen de mtodos

void onBulletHit (BulletHitEvent event)

This method is called when one of your bullets hits another robot.
// Este mtodo se llama cuando uno de tus balas golpea a otro robot.
void onBulletHitBullet (BulletHitBulletEvent event)

This method is called when one of your bullets hits another bullet. // Este mtodo se llama cuando uno de tus balas golpea otra bala.
void onBulletMissed (BulletMissedEvent event)

This method is called when one of your bullets misses, i.e. hits a wall. // Este mtodo se llama cuando una de sus balas se pierde, es decir, golpea
una pared.
void onDeath(DeathEvent event)

This method is called if your robot dies.


// Este mtodo se llama, si el robot muere .
void onHitByBullet (HitByBulletEvent event)

This method is called when your robot is hit by a bullet. // Este mtodo se llama cuando el robot es alcanzado por una bala.
void onHitRobot (HitRobotEvent event)

This method is called when your robot collides with another robot.
// Este mtodo es llamado cuando el robot choca con otro robot
void onHitWall (HitWallEvent event)

This method is called when your robot collides with a wall. // Este mtodo es llamado cuando el robot choca con una pared
void onRobotDeath (RobotDeathEv ent event)

This method is called when another robot dies.


// Este mtodo se llama cuando otro robot muere
void onScannedRobot (ScannedRobotEvent event)

This method is called when your robot sees another robot, i.e. when the robot's radar scan "hits" another robot. // Este mtodo se llama cuando el robot ve a otro robot, es decir, cuando el
radar del robot de exploracin "xitos" a otro robot.
void onStatus(StatusEvent event)

This method is called every turn in a battle round in order to provide the robot status as a complete snapshot of the robot's current state at that specific time.
// Este mtodo se llama cada vez en una ronda de batalla a fin de proporcionar el estado del robot como una imagen completa del estado actual del robot, en ese momento.
void onWin(WinEvent event)

This method is called if your robot wins a battle.


// Este mtodo se llama el robot si gana una batalla.

Metodo Detalle void onStatus(StatusEvent event)


Este mtodo se llama cada vez en una ronda de batalla a fin de proporcionar el estado del robot como una imagen completa del estado actual del r obot, en ese momento. La principal ventaja de este mtodo es que usted recibir automticamente todos los valores de los datos actuales del robot, como por ejemplo, las coordenadas X e Y, rumbo, etc pistola de aire caliente, que se agrupan en el momento ex acto el mismo turno. Esta es la nica manera de asignar los valores de los datos robots para una hora especfica. Por ejemplo, no es posible determinar la hora exacta del robot de la partida llamando Robot.getTime() primera llamada y luego Robot.getHeading () despus, como el tiempo puede cambiar despus de que entre los Robot.getTime () y Robot. getHeading () llamada. Parmetros: event - el evento que contiene el estado del robot en el momento en que ocurri. Desde: 1.5 Vea tambin: StatusEvent, evento //-----------------------------------------------------------------------------------------------------------------StatusEvent, evento

Class StatusEvent
public final class StatusEvent extends Event

Este evento se enva al onStatus () cada vez, en una batalla para proporcionar el estado del robot Vea tambin: Serializado Formulario

Constructor Summary

( Constructor Resumen )

StatusEvent (RobotStatus status)

This constructor is called internally from the game in order to create a new RobotStatus .
// Este constructor es llamado internamente por el juego con el fin de crear una

nueva RobotStatus.

Method Summary ( Resumen de metodo )


RobotStatus getStatus()

Returns the RobotStatus at the time defined by Robot.getTime() . // Devuelve el RobotStatus en el tiempo definido por Robot.getTime (). Methods inherited from class robocode.Event
( Mtodos heredados de la clase robocode.Event )

compareTo , getPriority , getTime, setPriority , setTime

Methods inherited from class java.lang.Object


clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor detalle StatusEvent


public StatusEvent (RobotStatus status)
Este constructor es llamado internamente por el juego con el fin de crear una nueva RobotStatus.

Parameters:
status - the current states

Metodo Detalle getStatus


public RobotStatus getStatus()

Devuelve el RobotStatus en el tiempo definido por Robot.getTime ().

Returns:
la RobotStatus en el tiempo definido por Robot.getTime (). Vea tambin:

Event.getTime()

//--------------------------------------------------------------------------------------------------- -----------------------onBulletHit void onBulletHit(BulletHitEvent event)


Este mtodo se llama cuando uno de tus balas golpea a otro robot. Usted debe reemplazar en el robot si quieres estar informado de este evento

Example:
public void onBulletHit(BulletHitEvent event) { out.println("I hit " + event.getName() + "!"); }

Parmetros: event - el evento de bala golpe establecido por el juego Vea tambin: BulletHitEvent, event

//--------------------------------------------------------------------------------------------------------------------------BulletHitEvent, event

Class BulletHitEvent All Implemented Interfaces: Serializable, Comparable


public final class BulletHitEvent extends Event

Vease tambien: Serialized Form

Constructor Summary ( constructor resumen )


BulletHitEvent (String name, double energy, Bullet bullet)

Called by the game to create a new BulletHitEvent . // Lo llama el juego para crear una nueva BulletHitEvent.

Method Summary
Bullet getBullet ()

( Metodos resumen )

Returns the bullet of yours that hit the robot. // Devuelve la bala de los suyos que azot el robot.

double getEnergy ()

Returns the remaining energy of the robot your bullet has hit (after the damage done by your bullet). // Devuelve la energa restante del robot ha llegado a su bala (despus de los daos causados por la bala).
double getLife()

Deprecated. Use BulletHitEvent.getEnergy() instead. // Obsoletas. Utilice BulletHitEvent.getEnergy () en lugar


String getName()

Returns the name of the robot your bullet hit. // Devuelve el nombre del robot de su bala (pego)
double getRobotLife ()

Deprecated. Use BulletHitEvent.getEnergy() instead.


String getRobotName ()

Deprecated. Use BulletHitEvent.getName() instead.


Metodo Detalle

getBullet
public Bullet getBullet ()

Devuelve la bala de los suyos que azot el robot

Returns:
la bala que golpe el robot

getEnergy
public double getEnergy ()

Devuelve la energa restante del robot ha llegado a su bala (despus de los daos causados por la bala).

Returns:
la energa de la energa restante del robot que la bala ha afectado

getName
public String getName()

Devuelve el nombre del robot de su bala

Returns:
el nombre del robot de la bala

//------------------------------------------- -------------------------------------------------------------------------------//---------------------------------------------------------------------------------------------------------------------------

onBulletHitBullet
void onBulletHitBullet (BulletHitBulletEvent event)

Este mtodo se llama cuando uno de tus balas golpea otra bala. Usted debe reemplazar en el robot si quieres estar informado d e este evento

Example:
public void onBulletHitBullet(BulletHitBulletEvent event) { out.println("I hit a bullet fired by " + event.getBullet().getName() + "!"); }

Parameters: - the bullet-hit-bullet event set by the game //el evento de bala-golpear-bala establecido por el juego Vase tambin; BulletHitBulletEvent , Event
event

//--------------------------------------------------------------------------------------------------------------------------BulletHitBulletEvent public final class BulletHitBulletEvent extends Event

Este evento se enva al onBulletHitBullet cuando una de sus balas ha afectado a otra bala

Vease tambien: Serialized Form

Constructor Summary ( Constructor Resumen )


BulletHitBulletEvent (Bullet bullet, Bullet hitBullet)

Called by the game to create a new BulletHitEvent . // Lo llama el juego para crear una nueva BulletHitEvent

Method Summary
Bullet getBullet ()

( Metodo Resumen )

Returns your bullet that hit another bullet. // Devuelve la bala que afect a otra bala
Bullet getHitBullet ()

Returns the bullet that was hit by your bullet. // Devuelve la bala que fue alcanzado por la bala.

Methods inherited from class robocode.Event

( Mtodos heredados de la clase robocode.Event )

compareTo , getPriority , getTime, setPriority , setTime

Methods inherited from class java.lang.Object

( Mtodos heredados de la clase java.lang.Object )

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail ( Contructor Detalle )


BulletHitBulletEvent
public BulletHitBulletEvent (Bullet bullet, Bullet hitBullet)

Lo llama el juego para crear una nueva BulletHitEvent

Parameters:
bullet - la bala que afect a otra bala hitBullet - la bala que fue alcanzado por la bala

Method Detail ( Metodo Detalle )


getBullet
public Bullet getBullet ()

Devuelve la bala que afect a otra bala

Returns:
su bala

getHitBullet
public Bullet getHitBullet ()

Devuelve la bala que fue alcanzado por la bala.

Returns:
la bala que fue golpeado

//--------------------------------------------------------------------------------------------------------------------------//---------------------------------------------------------------------------------------------------------------------------

onBulletMissed
void onBulletMissed (BulletMissedEvent event)

This method is called when one of your bullets misses, i.e. hits a wall. You should override it in your robot if you want to be informed of this event.
//Este mtodo se llama cuando una de sus balas se pierde, es decir, gol pea una pared. Usted debe reemplazar en el robot si quieres estar informado de este evento.

Example:
public void onBulletMissed(BulletMissedEvent event) { out.println("Drat, I missed."); }

Parameters:
event - the bullet-missed event set by the game

// la bala-evento perdido fijados por el juego Vease tambien:


BulletMissedEvent , Event

//--------------------------------------------------------------------------------------------------------------------------BulletMissedEvent

Class BulletMissedEvent All Implemented Interfaces: Serializable, Comparable


public final class BulletMissedEvent extends Event Este evento se enva al onBulletMissed cuando una de sus balas se ha perdido, es decir, cuando la bala ha alcanzado la frontera del campo de batalla

Vase tambien: Serialized Form

Constructor Summary ( Constructor Resumen )


BulletMissedEvent (Bullet bullet)

Called by the game to create a new BulletMissedEvent . // Lo llama el juego para crear una nueva BulletMissedEvent.

Method Summary ( Metodo Resumen )


Bullet getBullet ()

Returns the bullet that missed. // Devuelve la bala que se perdi. Methods inherited from class robocode.Event
( Mtodos heredados de la clase robocode.Event )

compareTo , getPriority , getTime, setPriority , setTime

Methods inherited from class java.lang.Object

( Mtodos heredados de la clase java.lang.Object )

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail ( Constructor Detalle )


BulletMissedEvent
public BulletMissedEvent (Bullet bullet)

Lo llama el juego para crear una nueva BulletMissedEvent

Parameters:
bullet - la bala que se perdi

Method Detail ( Metodo detalle )


getBullet
public Bullet getBullet ()

Devuelve la bala que se perdi

Returns:
la bala que se perdi

//---------------------------------------------------------------------------------------------------------------------------

onDeath
void onDeath(DeathEvent event)

Este mtodo se llama, si el robot muere


Usted debe reemplazar en el robot si quieres estar informado de este evento. Las acciones no tienen ningn efecto si se llama desde esta seccin. La intencin es permitir que usted realice clculos o imprimir alg o cuando el robot es asesinado

Parameters:
event - el caso de la muerte establecido por el juego

Vease tambien:
DeathEvent , WinEvent , RoundEndedEvent , BattleEndedEvent , Event

//--------------------------------------------------------------------------------- -----------------------------------------//---------------------------------------------------------------------------------------------------------------------------

onHitByBullet
void onHitByBullet (HitByBulletEvent event)

Este mtodo se llama cuando el robot es alcanzado por una bala. Usted debe reemplazar en el robot si quieres estar informado de este evento. Example:
void onHitByBullet( HitByBulletEvent event) { out.println(event.getRobotName() + " hit me!"); }

Parameters:
event - the hit-by-bullet event set by the game

// el golpe-por-evento de bala establecido por el juego Vaese tambien:


HitByBulletEvent , Event

//--------------------------------------------------------------------------------------------------------------------------HitByBulletEvent

Class HitByBulletEvent

Un HitByBulletEvent se enva a onHitByBullet () cuando el robot ha sido alcanzado por una bala. Puede utilizar la informacin contenida en este evento para determinar qu hacer.

Constructor Summary ( Constructor Resumen )


HitByBulletEvent (double bearing, Bullet bullet)

Called by the game to create a new HitByBulletEvent. // Lo llama el juego para crear una nueva HitByBulletEvent

Method Summary
double getBearing ()

( Metoso Resumen )

Returns the bearing to the bullet, relative to your robot's heading, in degrees (-180 < getBearing() <= 180). //Devuelve el rumbo en relac in con la bala, en relacin con el robot de la partida, en grados ( -180 <getBearing () <= 180).
double getBearingRadians ()

Returns the bearing to the bullet, relative to your robot's heading, in radians (-Math.PI < getBearingRadians() <= Math.PI). // Devuelve el rumbo en relacin con la bala, en relacin con el robot de la partida, en radianes ( -Math.PI <getBearingRadians () <= Math.PI).
Bullet getBullet ()

Returns the bullet that hit your robot. // Devuelve la bala que afect a su robot
double getHeading ()

Returns the heading of the bullet when it hit you, in degrees (0 <= getHeading() < 360). // Devuelve el ttulo de la bala cuando te diste cuenta, en grados (0 <= getHeading () <360).
double getHeadingDegrees ()

Deprecated. Use HitByBulletEvent.getHeading() instead. // Obsoletas. Utilice HitByBulletEvent.getHeading () en lugar


double getHeadingRadians ()

Returns the heading of the bullet when it hit you, in radians (0 <= getHeadingRadians() < 2 * PI). // Devuelve el ttulo de l a bala cuando te diste cuenta, en radianes (0 <= getHeadingRadians () <2 * PI).
String getName()

Returns the name of the robot that fired the bullet. // Devuelve el nombre del robot que dispar la bala.
double getPower()

Returns the power of this bullet.

// Devuelve el poder de la bala.


double getVelocity ()

Returns the velocity of this bullet. // Devuelve la velocidad de la bala Methods inherited from class robocode.Event
compareTo , getPriority , getTime, setPriority , setTime

Methods inherited from class java.lang.Object


clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail
HitByBulletEvent

( Constructor Detalle )

public HitByBulletEvent (double bearing, Bullet bullet)

Lo llama el juego para crear una nueva HitByBulletEvent

Parameters:
bearing - the bearing of the bullet that hit your robot, in radians

// el bearing de la bala que afect a su robot, en radianes


bullet - la bala que ha afectado a su robot

Method Detail
getBearing

( Metodo Detalle )

public double getBearing ()

Devuelve el rumbo en relacin con la bala, en relacin con el robot de la partida, en grados (-180 <getBearing () <= 180 ).
Si usted fuera a turnRight (event.getBearing ()), que se enfrenta la direccin de la bala vino. El clculo se utiliza aqu es: (bala rumbo en grados + 180) - (su rumbo en grados)

Returns: the bearing to the bullet, in degrees


// el bearing de la bala, en grados

getBearingRadians
public double getBearingRadians ()

Devuelve el rumbo en relacin con la bala, en relacin con el robot de la partida, en radianes (-Math.PI <getBearingRadians () <= Math.PI).
Si usted fuera a turnRightRadians (event.getBearingRadians ()), que se enfrenta la direccin de la bala vino. El clculo se utiliza aqu es: (bala partida en radianes + Math.PI) - (su direccin en radianes)

Returns:
el bearing de la bala, en radianes

getBullet
public Bullet getBullet ()

Devuelve la bala que afect a su robot .

Returns:
la bala que afect a su robo t

getHeading
public double getHeading ()

Returns the heading of the bullet when it hit you, in degrees (0 <= getHeading() < 360).
// Devuelve el heading de la bala cuando te diste cuenta, en grados (0 <= getHeading () <360).

Nota: Esto no es relativa a la direccin en la que se enfrentan. El robot que dispar la bala fue en la direccin opuesta de getHeading () cuando se dispar la bala.

Returns: the heading of the bullet, in degrees


// el heading de la bala, en g rados

getHeadingRadians
public double getHeadingRadians ()

Devuelve el heading de la bala cuando te diste cuenta, en radianes (0 <= getHeadingRadians () <2 * PI).
Nota: Esto no es relativa a la direccin en la que se enfrentan. El robot que dispar la bal a fue en la direccin opuesta de getHeadingRadians () cuando se dispar la bala

Returns:
El heading de la bala, en radianes

getName
public String getName()

Devuelve el nombre del robot que dispar la bala .

Returns:
el nombre del robot que dispar la bala

getPower
public double getPower()

Returns the power of this bullet. The damage you take (in fact, already took) is 4 * power, plus 2 * (power-1) if power > 1. The robot that fired the bullet receives 3 * power back. // Devuelve el poder de la bala. El dao que recibes (de hecho, y a se) es de 4 * power,plus 2 * (power -1) if power> 1. El robot que dispar la bala recibe energa de 3 *power back. (alimentacion) Returns:
el poder de la bala

getVelocity
public double getVelocity ()

Devuelve la velocidad de la bala .

Returns:
la velocidad de la bala

//--------------------------------------------------------------------------------------------------------------------------//------------------------------------------------------------------------------------------- --------------------------------

onHitRobot
void onHitRobot (HitRobotEvent event)

This method is called when your robot collides with another robot. You should override it in your robot if you want to be informed of this event.

Example:
void onHitRobot(HitRobotEvent event) { if (event.getBearing() > -90 && event.getBearing() <= 90) { back(100); } else { ahead(100); } } -- or perhaps, for a more advanced robot - - -// o tal vez, para un robot ms avanzado - - public void onHitRobot(HitRobotEvent event) { if (event.getBearing() > -90 && event.getBearing() <= 90) { setBack(100); } else { setAhead(100); } }

The angle is relative to your robot's facing. So 0 is straight ahead of you. // El ngulo es relativo a su robot se enfrenta. Por lo que 0 es recto delante de usted This event can be generated if another robot hits you, in which case will return false. In this case, you will not be automatically stopped by the game -- but if you continue moving toward the robot you will hit it (and generate another event). If you are moving away, then you won't hit it.
event.isMyFault()

Este evento se puede generar si otro robot que realiza, en los que event.isMyFault() caso devolver false. En este caso, no se detiene automticamente por el juego -, pero si contina avanzando hacia el robot que lo golpe (y generar otro evento). Si se alejan, entonces no lo golpe.

Parameters:
event - the hit-robot event set by the game

//

el caso de xito-robot establecido por el juego

Vease Tambien:
HitRobotEvent , Event

//------------------------------------------------- -------------------------------------------------------------------------HitRobotEvent

Class HitRobotEvent
public final class HitRobotEvent extends Event

Un HitRobotEvent se enva a onHitRobot () cuando el robot choca con otro robot. Puede utilizar la informacin contenida en este evento para determinar qu hacer

Vase tambien: Serialized Form

Constructor Summary ( Constructor Resumen )


HitRobotEvent(String name, double bearing, double energy, boolean atFault)
Called by the game to create a new HitRobotEvent.

// Lo llama el juego para crear una nueva HitRobotEvent

Method Summary

( Mtodos Resumen")

int compareTo(Event event)

Compares this event to another event regarding precedence.


// Compara este evento a otro evento relacionadas con la precedencia

double getBearing ()

Returns the bearing to the robot you hit, relative to your robot's heading, in degrees (-180 <= getBearing() < 180)
// Devuelve el bearing en relacin con el robot te golpea, en relacin con el robot de la partida, en grados (-180 <= getBearing () <180)

double getBearingDegrees ()

Deprecated. Use HitRobotEvent.getBearing() instead. // Obsoletas. Utilice HitRobotEvent.getBearing () en lugar


double getBearingRadians ()

Returns the bearing to the robot you hit, relative to your robot's heading, in radians (-PI <= getBearingRadians() < PI)
// Devuelve el bearing en relacin con el robot le golpe, en relacin con el robot de la partida, en radianes (-PI <= getBearingRadians () <PI). double getEnergy()

Returns the amount of energy of the robot you hit.

// Devuelve la cantidad de energa del robot te ha golpeado String getName()

Returns the name of the robot you hit.


// Devuelve el nombre del robot te ha golpeado. String getRobotName ()

Deprecated. Use HitRobotEvent.getName() instead. // Obsoletas. Utilice HitRobotEvent.getName () en lugar


boolean isMyFault()

Checks if your robot was moving towards the robot that was hit. // Comprueba si el robot se mova hacia el robot que fue golpeado.

Methods inherited from class robocode.Event


getPriority , getTime, setPriority , setTime

Methods inherited from class java.lang.Object


clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail ( Constructor Detalle )


HitRobotEvent
Public HitRobotEvent (String name,double bearing,double energy, boolean atFault)

Called by the game to create a new HitRobotEvent. // Lo llama el juego para crear una nueva HitRobotEvent Parameters:
name - the name of the robot you hit

//el nombre del robot que golpe


bearing - the bearing to the robot that your robot hit, in radians

// el rumbo hacia el robot q ue el robot xito, en radianes


energy - the amount of energy of the robot you hit

// la cantidad de energa del robot que golpe


atFault - true if your robot was moving toward the other robot; false otherwise

// true if el robot se mova hacia el otro robot, false en caso contrario

Method Detail
getBearing
public double getBearing ()

( Mtodo Detalle )

Returns the bearing to the robot you hit, relative to your robot's heading, in degrees (180 <= getBearing() < 180)
// Devuelve el bearing en relacin con el robot te golpea, en relacin con el robot de la partida, en grados (-180 <= getBearing () <180)

Returns: the bearing to the robot you hit, in degrees


// el bearing a la que golpe robot, en grados

getBearingRadians
public double getBearingRadians ()

Returns the bearing to the robot you hit, relative to your robot's heading, in radians (PI <= getBearingRadians() < PI)
// Devuelve el rumbo en relacin con el robot le golpe, en relacin con el robot de la partida, en radianes ( -PI <= getBearingRadians () <PI)

Returns: the bearing to the robot you hit, in radians // el bearing a la que golpe robot, en radianes

getEnergy
public double getEnergy ()

Devuelve la cantidad de energa del robot te ha golpeado.

Returns:
la cantidad de energa del robot que golpe

getName
public String getName()

Devuelve el nombre del robot que golpe .

Returns:
el nombre del robot que golpe

isMyFault
public boolean isMyFault()

Comprueba si el robot se mova hacia el robot que fue golpeado

If HitRobotEvent.isMyFault() returns true then your robot's movement (including turning) will have stopped and been marked complete
If HitRobotEvent.isMyFault() devuelve true entonces el movimiento del robot (incluyendo consultas) se ha detenido y ha marcado completa.

Note: If two robots are moving toward each other and collide, they will each receive two HitRobotEvents. The first will be the one if HitRobotEvent.isMyFault() returns true.
// Nota: Si dos robots se mueven uno hacia el otro y chocan, que recibirn cada uno dos HitRobotEvents. El primero ser el si HitRobotEvent.isMyFault() debuelve true.

Returns:
true si el robot se mova hacia el robot que fue golpeado, false en caso contrario

compareTo
public final int compareTo(Event event) Compara este evento a otro evento relacionadas con la precedencia. La precedencia de eventos es, ante todo, determinado por la hora del evento, en segundo lugar la prioridad de eventos, y por ltimo informacin sobre la prueba especfica.

.
Este primer mtodo se compara el tiempo de cada evento. Si la hora del evento es el mismo para ambos eventos, a continuacin, este mtodo de comparacin la prioridad de cada caso. Si el evento prioridades son iguales, entonces este mtodo se compara el evento de dos sobre la base de informacin de eventos especficos. Este mtodo es llamado por el juego con el fin de ordenar la cola de eventos de un robot para asegurarse de que los eventos se muestran en orden cronolgico .

Specified by:
compareTo in interface Comparable

Overrides:
compareTo in class Event

Parameters:
event - the event to compare to this event.

//

el caso de comparar a este evento

Returns:
un valor negativo si este evento tiene mayor prioridad, es decir, deben estar inscritos antes del evento especificado. Un valor positivo si este evento tiene una prioridad ms baja, es decir, debe aparecer despus de que el evento especificado. 0 significa que la prioridad de los dos eventos son iguales

//--------------------------------------------------------------------------------------------------------------------------//-------------------------------------------------------------------------------- -------------------------------------------

onHitWall
void onHitWall(HitWallEvent event) Este mtodo es llamado cuando el robot choca con una pared. Usted debe reemplazar en el robot si quieres estar informado de este evento.

The wall at the top of the screen is 0 degrees, right is 90 degrees, bottom is 180 degrees, left is 270 degrees. But this event is relative to your heading, so: The bearing is such that turnRight (event.getBearing()) will point you perpendicular to the wall.
// La pared en la parte superior de la pantalla es de 0 grados, a la derecha es de 90 grados, el fondo es de 180 grados, a la izquierda es de 270 grados. Pero este caso es relativo a su partida, as que: El rodamiento es tal que turnRight (event.getBearing ()) ser punto perpendicular a la pared.

Example:
void onHitWall(HitWallEvent event) { out.println("Ouch, me golpeo una pared del bearing " + event.getBearing() + " grados."); }

Parameters:
event - el caso de golpear la pared establecida por el juego

See Also:
HitWallEvent , Event

//--------------------------------------------------------------------------------------------------------------------------HitWallEvent

Class HitWallEvent
public final class HitWallEvent extends Event

A HitWallEvent is sent to onHitWall() when you collide a wall. You can use the information contained in this event to determine what to do.
// Un HitWallEvent se enva a onHitWall () cuando chocan una pared. Puede utilizar la informacin contenida en este evento para determinar qu hacer.

Vase tambien: Serialized Form

Constructor Summary
HitWallEvent (double bearing)

Called by the game to create a new HitWallEvent.


// Lo llama el juego para crear una nueva HitWallEvent

Method Summary
double getBearing ()

Returns the bearing to the wall you hit, relative to your robot's heading, in degrees (-180 <= getBearing() < 180)
// Devuelve el rumbo en relacin con la que golpe la pared, en relacin con el robot de la partida, en grados (-180 <= getBearing () <180)

double getBearingDegrees () Deprecated. Use HitWallEvent.getBearing() instead. // Obsoletas. Utilice HitWallEvent.getBearing () en lugar. double getBearingRadians ()

Returns the bearing to the wall you hit, relative to your robot's heading, in radians (-PI <= getBearingRadians() < PI)
//Devuelve el rumbo en relacin con la que golpe la pared, en relacin con el robot de la partida, en radianes (-PI <= getBearingRadians () <PI)

Methods inherited from class robocode.Event


compareTo , getPriority , getTime, setPriority , setTime

Methods inherited from class java.lang.Object


clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail ( Constructor Detalle )


HitWallEvent
public HitWallEvent (double bearing)

Called by the game to create a new HitWallEvent.


// Lo llama el juego para crear una nueva HitWallEvent

Parameters:
bearing - the bearing to the wall that your robot hit, in radian

// el rumbo hacia la pared que el robot xito, en radianes

Method Detail ( Metodo Detalle )


getBearing
public double getBearing () Devuelve el bearing en relacin con la que golpe la pared, en relacin con el robot de la partida, en grados (-180 <= getBearing () <180)

Returns: the bearing to the wall you hit, in degrees // el bearing a la que golpe la pared, en grados

getBearingRadians
public double getBearingRadians ()

Returns the bearing to the wall you hit, relative to your robot's heading, in radians (-PI <= getBearingRadians() < PI)
// Devuelve el bearing en relacin con la que golpe la pared, en relacin con el robot de la partida, en radianes (-PI <= getBearingRadians () <PI)

Returns: the bearing to the wall you hit, in radians // el bearing a la que golpe la pared, en radianes

//--------------------------------------------------------------------------------------------------------------------------//---------------------------------------------------------------------------------------------------------------------------

onScannedRobot
void onScannedRobot(ScannedRobotEvent event)

This method is called when your robot sees another robot, i.e. when the robot's radar scan "hits" another robot. You should override it in your robot if you want to be informed of this event. (Almost all robots should override this!)
// Este mtodo se llama cuando el robot ve a otro robot, es decir, cuando el radar del robot de exploracin "xitos" a otro robot. Usted debe reemplazar en el robot si quieres estar informado de este evento. (Casi todos los robots deben reemplazar este!)

This event is automatically called if there is a robot in range of your radar.


// Este evento se llama automticamente si hay un robot dentro del alcance de su radar

Rules.RADAR_SCAN_RADIUS

Note that the robot's radar can only see robot within the range defined by (1200 pixels).

// Tenga en cuenta que el radar del robot slo puede ver robot dentro del rango definido por Rules.RADAR_SCAN_RADIUS (1200 pxeles).

Also not that the bearing of the scanned robot is relative to your robot's heading.
// Tampoco que el rodamiento del robot es escaneada en relacin con el robot de la partida

Example:
void onScannedRobot(ScannedRobotEvent event) { // Assuming radar and gun are aligned... //Suponiendo que la pistola de radar y se alinean if (event.getDistance() < 100) { fire(3); } else { fire(1); } }

Note: The game assists Robots in firing, as follows:


y y

If the gun and radar are aligned (and were aligned last turn), and the event is current,

and you call fire() before taking any other actions, fire() will fire directly at the robot.

//Tenga en cuenta: El juego ayuda a los robots en el fuego, de la siguiente manera: Si el arma y el radar estn alineados (y se alinearon la ltima vuelta), y el evento es actual, y llama de fire () antes de tomar cualquier otra accin, el fire () se dispara directamente en el robot.

In essence, this means that if you can see a robot, and it doesn't move, then fire will hit it.
// En esencia, esto significa que si usted puede ver un robot, y no se mueve, entonces el fuego lo golpe

AdvancedRobots will NOT be assisted in this manner, and are expected to examine the event to determine if fire() would hit. (i.e. you are spinning your gun around, but by the time you get the event, your gun is 5 degrees past the robot).
//AdvancedRobots NO contar con la ayuda de esta manera, y se espera que examinar el caso para determinar si el fire () golpeara. (Es decir, que estn girando alrededor de su arma, pero cuando usted consigue el evento, su arma es de 5 grados despus de que el robot).

Parameters:
event - the scanned-robot event set by the game

// el caso de escaneado -robot establecido por el juego

Vease tambien:
ScannedRobotEvent , Event , Rules.RADAR_SCAN_RADIUS

//--------------------------------------------------------------------------------------------------------------------------ScannedRobotEvent

Class ScannedRobotEvent All Implemented Interfaces: Serializable, Comparable

public class ScannedRobotEvent extends Event

Un ScannedRobotEvent se enva a onScannedRobot () cuando se escanea un robot. Puede utilizar la informacin contenida en este evento para determinar qu hacer

Nota: No debe heredar de esta clase en su propia clase de evento! La lgica interna de esta clase de eventos pueden cambiar. Por lo tanto, el robot puede que no funcione en futuras versiones de Robocode, si decide heredar de esta clase.

Vase tambien: Serialized Form

Constructor Summary ( Costructor Resumen )


ScannedRobotEvent ()

Deprecated. Use ScannedRobotEvent.ScannedRobotEvent(String, double,


double, double, double, double) instead. // Obsoletas. Utilice ScannedRobotEvent.ScannedRobotEvent (String, dobles, dobles, dobles, dobles, dobles) en su lugar. ScannedRobotEvent (String name, double energy, double bearing, double distance, double heading, double velocity)

Called by the game to create a new ScannedRobotEvent. // Lo llama el juego para crear una nueva ScannedRobotEvent

Method Summary ( Mtodos Resumen )


int compareTo (Event event)

Compares this event to another event regarding precedence. // Compara este evento a otro evento relacionadas con la precedencia
double getBearing ()

Returns the bearing to the robot you scanned, relative to your robot's heading, in degrees (-180 <= getBearing() < 180)
// Devuelve el rumbo en relacin con el robot que ha analizado, en relacin con el robot de la partida, en grados (-180 <= getBearing () <180).

double getBearingRadians ()

Returns the bearing to the robot you scanned, relative to your robot's heading, in radians (-PI <= getBearingRadians() < PI) // Devuelve el rumbo en relacin con el robot que ha analizado, en relacin con el robot de la partida, en radianes ( -PI <= getBearingRadians () <PI)
double getDistance ()

Returns the distance to the robot (your center to his center).


// Devuelve la distancia al robot (el centro de su centro).

double getEnergy ()

Returns the energy of the robot. // Devuelve la energa del robot.


double getHeading ()

Returns the heading of the robot, in degrees (0 <= getHeading() < 360) // Devuelve el heading del robot, en grados (0 <= getHeading () <360)
double getHeadingRadians ()

Returns the heading of the robot, in radians (0 <= getHeading() < 2 * PI) //Devuelve el heading del robot, en radianes (0 < = getHeading () <2 * PI)
double getLife()

Deprecated. Use ScannedRobotEvent.getEnergy() instead. // Obsoletas. Utilice ScannedRobotEvent.getEnergy () en lugar.


String getName()

Returns the name of the robot. // Devuelve el nombre del robot.


double getRobotBearing ()

Deprecated. Use ScannedRobotEven t.getBearing() instead. Obsoletas. Utilice ScannedRobotEvent.getBearing () en lugar.


double getRobotBearingDegrees () Deprecated. Use ScannedRobotEvent.getBearing() instead.

Obsoletas. Utilice ScannedRobotEvent.getBearing () en lugar.


double getRobotBearingRadians ()

Deprecated. Use ScannedRobotEvent.getBearingRadians() instead. Obsoletas. Utilice ScannedRobotEvent.getBearingRadians () en lugar.


double getRobotDistance ()

Deprecated. Use ScannedRobotEvent.getDistance() instead. Obsoletas. Utilice ScannedRobotEvent.getDistance () en lugar.


double getRobotHeading ()

Deprecated. Use ScannedRobotEven t.getHeading() instead.


double getRobotHeadingDegrees ()

Deprecated. Use ScannedRobotEvent.getHeading() instead.


double getRobotHeadingRadians () Deprecated. Use ScannedRobotEvent.getHeadingRadians() instead. double getRobotLife ()

Deprecated. Use ScannedRobotEvent.getEnergy() instead.


String getRobotName ()

Deprecated. Use ScannedRobotEvent.getName() instead.


double getRobotVelocity ()

Deprecated. Use ScannedRobotEvent.getVelocity() instead.


double getVelocity ()

Returns the velocity of the robot. // Devuelve la velocidad del robot.

Methods inherited from class robocode.Event


getPriority , getTime, setPriority , setTime

Methods inherited from class java.lang.Object


clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail ( Construstor Detalle )


ScannedRobotEvent
public ScannedRobotEvent (String double double double double double name, energy, bearing, distance, heading, velocity)

Called by the game to create a new ScannedRobotEvent. // Lo llama el juego para crear una nueva ScannedRobotEvent Parameters:
name - the name of the scanned robot

//El nombre del robot escaneada


energy - the energy of the scanned robot

// la energa de los escaneados robot


bearing - the bearing of the scanned robot, in radians

//el bearing del escaneado del robot, en radianes


distance - the distance from your robot to the scanned robot

// la distancia de su robot para el escaneado del robot


heading - the heading of the scanned robot

// el ttulo de la imagen escaneada del robot


velocity - the velocity of the scanned robot

// la velocidad de escaneado robot

Method Detail ( Metodo Detalle )


getBearing
public double getBearing ()

Returns the bearing to the robot you scanned, relative to your robot's heading, in degrees (-180 <= getBearing() < 180)

// Devuelve el rumbo en relacin con el robot que ha analizado, en relacin con el robot de la partida, en grados ( -180 <= getBearing () <180)

Returns: the bearing to the robot you scanned, in degrees // el rumbo hacia el robot que escanea, en grados

getBearingRadians
public double getBearingRadians ()

Returns the bearing to the robot you scanned, relative to your robot's heading, in radians (-PI <= getBearingRadians() < PI)
// Devuelve el bearing en relacin con el robot que ha analizado, en relacin con el robot de la partida, en radianes (-PI <= getBearingRadians () <PI)

Returns: the bearing to the robot you scanned, in radians // el rumbo hacia el robot que escanea, en radianes

getDistance
public double getDistance ()

Devuelve la distancia al robot (el centro de su centro).

Returns:
la distancia al robot

getEnergy
public double getEnergy ()

Returns the energy of the robot. // Devuelve la energa del robot Returns:
la energa del robot

getHeading
public double getHeading ()

Returns the heading of the robot, in degrees (0 <= getHeading() < 360)
// Devuelve el heading del robot, en grados (0 <= getHeading () <360)

Returns: the heading of the robot, in degrees // el heading del robot, en grados

getHeadingRadians
public double getHeadingRadians ()

Returns the heading of the robot, in radians (0 <= getHeading() < 2 * PI) // Devuelve el heading del robot, en radianes (0 <= getHeading () <2 * PI) Returns: the heading of the robot, in radians // el ttulo del robot, en radianes

getName
public String getName()

Returns the name of the robot. // Devuelve el nombre del robot. Returns:
el nombre del robot

getVelocity
public double getVelocity ()

Devuelve la velocidad del robot .

Returns:

la velocidad del robot

compareTo
public final int compareTo(Event event)

Compares this event to another event regarding precedence. The event precedence is first and foremost determined by the event time, secondly the event priority, and lastly specific event information.
// Compara este evento a otro evento relac ionadas con la precedencia. La precedencia de eventos es, ante todo, determinado por la hora del evento, en segundo lugar la prioridad de eventos, y por ltimo informacin sobre la prueba especfica.

This method will first compare the time of each event. If the event time is the same for both events, then this method compared the priority of each event. If the event priorities are equals, then this method will compare the two event based on specific event information.
// Este primer mtodo se compara el ti empo de cada evento. Si la hora del evento es el mismo para ambos eventos, a continuacin, este mtodo de comparacin la prioridad de cada caso. Si el evento prioridades son iguales, entonces este mtodo se compara el evento de dos sobre la base de informacin de eventos especficos.

This method is called by the game in order to sort the event queue of a robot to make sure the events are listed in chronological order.
// Este mtodo es llamado por el juego con el fin de ordenar la cola de eventos de un robot para asegurarse de que los eventos se muestran en orden cronolgico

Specified by:
compareTo in interface Comparable

Overrides:
compareTo in class Event

Parameters:
event - the event to compare to this event.

// caso de comparar a este evento. Returns: a negative value if this event has higher precedence, i.e. must be listed before the specified event. A positive value if this event has a lower precedence, i.e. must be

listed after the specified event. 0 means that the precedence of the two events are equal. // un valor negativo si este evento tiene mayor prioridad, es decir, deben estar inscritos antes del evento especificado. Un valor positivo si este evento tiene una prioridad ms baja, es decir, debe aparecer despus de que el evento especificado. 0 significa q ue la prioridad de los dos eventos son iguales. //--------------------------------------------------------------------------------------------------------------------------//-------------------------------------------------------------------------------- -------------------------------------------

onRobotDeath
void onRobotDeath (RobotDeathEvent event)

Este mtodo se llama cuando otro robot muere. Usted debe r eemplazar en el robot si quieres estar informado de este evento

Parameters:
event - The robot-death event set by the game

// El caso del robot de la muerte establecido por el juego See Also:


RobotDeathEvent , Event

onWin
void onWin(WinEvent event)

This method is called if your robot wins a battle.

Your robot could perform a victory dance here! :-)


// Este mtodo se llama el robot si gana una batalla. El robot puede realizar una danza de la victoria aqu! : -) Parameters:
event - the win event set by the game

// el caso de ganar establecido por el juego Vease tambien:


DeathEvent , RoundEndedEvent , BattleEndedEvent , Event

Das könnte Ihnen auch gefallen