IBM ROBO-CODE2007. 6. 30. 04:04

원본은.. http://robocode.sourceforge.net/docs/robocode/ 여기서..

Robot API (한글판)





Advanced Robot API (영문, 분류됨)

(원래는 알파벳 순서대로 되어 있어서 보기에 난감..ㅡㅡ)

처음에 테스트 정도는 Robot으로 해볼수 있으나..
제대로 된 Robot은.. 전부 Advanced Robot으로 되어 있는거 같네요..

대충.. 실행 방법은..
movement, gun, radar 함수를 실행시키면.. 예약되어 있다가..
execute를 실행시키면.. 함께 실행되는거 같네요..
그냥 Robot으로 만들면.. 한번에 하나씩 밖에 함수를 사용하지 못하는 불리한 점이 있습니다..



 

Movement Method

 void

setAhead(double distance)
          Sets the robot to move ahead (forward) by distance measured in pixels when the next execution takes place.

 void

setBack(double distance)
          Sets the robot to move back by distance measured in pixels when the next execution takes place.

 double

getDistanceRemaining()
          Returns the distance remaining in the robot's current move measured in pixels.

 void

setStop()
          This call is identical to Robot.stop(), but returns immediately, and will not execute until you call execute() or take an action that executes.

 void

setStop(boolean overwrite)
          This call is identical to Robot.stop(boolean), but returns immediately, and will not execute until you call execute() or take an action that executes.

 void

setResume()
          Sets the robot to resume the movement stopped by stop() or setStop(), if any.

 void

setMaxVelocity(double newMaxVelocity)
          Sets the maximum velocity of the robot measured in pixels/turn if the robot should move slower than Rules.MAX_VELOCITY (8 pixels/turn).

 void

setMaxTurnRate(double newMaxTurnRate)
          Sets the maximum turn rate of the robot measured in degrees if the robot should turn slower than Rules.MAX_TURN_RATE (10 degress/turn).

 void

setTurnLeft(double degrees)
          Sets the robot's body to turn left by degrees when the next execution takes place.

 void

setTurnRight(double degrees)
          Sets the robot's body to turn right by degrees when the next execution takes place.

 double

getTurnRemaining()
          Returns the angle remaining in the robots's turn, in degrees.

Radar Method

 boolean

isAdjustRadarForGunTurn()
          Checks if the radar is set to adjust for the gun turning, i.e. to turn independent from the gun's turn.

 boolean

isAdjustRadarForRobotTurn()
          Checks if the radar is set to adjust for the robot turning, i.e. to turn independent from the robot's body turn.

 void

setTurnRadarLeft(double degrees)
          Sets the robot's radar to turn left by degrees when the next execution takes place.

 void

setTurnRadarRight(double degrees)
          Sets the robot's radar to turn right by degrees when the next execution takes place.

 double

getRadarTurnRemaining()
          Returns the angle remaining in the radar's turn, in degrees.

Gun Method

 void

setFire(double power)
          Sets the gun to fire a bullet when the next execution takes place.

 Bullet

setFireBullet(double power)
          Sets the gun to fire a bullet when the next execution takes place.

 void

setTurnGunLeft(double degrees)
          Sets the robot's gun to turn left by degrees when the next execution takes place.

 void

setTurnGunRight(double degrees)
          Sets the robot's gun to turn right by degrees when the next execution takes place.

 double

getGunTurnRemaining()
          Returns the angle remaining in the gun's turn, in degrees.

 boolean

isAdjustGunForRobotTurn()
          Checks if the gun is set to adjust for the robot turning, i.e. to turn independent from the robot's body turn.

Event

Bullet Event

 Vector
<BulletHitBulletEvent>

getBulletHitBulletEvents()
          Returns a vector containing all BulletHitBulletEvents currently in the robot's queue.

 Vector
<BulletHitEvent>

getBulletHitEvents()
          Returns a vector containing all BulletHitEvents currently in the robot's queue.

 Vector
<BulletMissedEvent>

getBulletMissedEvents()
          Returns a vector containing all BulletMissedEvents currently in the robot's queue.

 Vector
<HitByBulletEvent>

getHitByBulletEvents()
          Returns a vector containing all HitByBulletEvents currently in the robot's queue.

Hit Event

 Vector
<HitRobotEvent>

getHitRobotEvents()
          Returns a vector containing all HitRobotEvents currently in the robot's queue.

 Vector
<HitWallEvent>

getHitWallEvents()
          Returns a vector containing all HitWallEvents currently in the robot's queue.

Enemy Robot Event

 Vector
<RobotDeathEvent>

getRobotDeathEvents()
          Returns a vector containing all RobotDeathEvents currently in the robot's queue.

 Vector
<ScannedRobotEvent>

getScannedRobotEvents()
          Returns a vector containing all ScannedRobotEvents currently in the robot's queue.

                                                                            Custom Event

 void

addCustomEvent(Condition condition)
          Registers a custom event to be called when a condition is met.

 void

removeCustomEvent(Condition condition)
          Removes a custom event (specified by condition).

 void

onCustomEvent(CustomEvent event)
          This method is called when a custom condition is met.

Etc

 void

onDeath(DeathEvent event)
          This method is called if your robot dies.

 void

onSkippedTurn(SkippedTurnEvent event)
          This method is called if the robot is using too much time between actions.

 int

getEventPriority(String eventClass)
          Returns the current priority of a class of events.

 void

setEventPriority(String eventClass, int priority)
          Sets the priority of a class of events.

 void

clearAllEvents()
          Clears out any pending events immediately.

 Vector
<Event>

getAllEvents()
          Returns a vector containing all events currently in the robot's queue.

 void

setInterruptible(boolean interruptible)
          Call this during an event handler to allow new events of the same priority to restart the event handler.

 void

setInterruptible(boolean interruptible)
          Call this during an event handler to allow new events of the same priority to restart the event handler.

Etc

 void

execute()
          Executes any pending actions, or continues executing actions that are in process.

 File

getDataFile(String filename)
          Returns a file in your data directory that you can write to using RobocodeFileOutputStream or RobocodeFileWriter.

 File

getDataDirectory()
          Returns a file representing a data directory for the robot, which can be written to using RobocodeFileOutputStream or RobocodeFileWriter.

 long

getDataQuotaAvailable()
          Returns the data quota available in your data directory, i.e. the amount of bytes left in the data directory for the robot.

 void

waitFor(Condition condition)
          Does not return until a Condition.test() returns
true.



Posted by BAGE