Trait

cwinter.codecraft.core.api

DroneControllerBase

Related Doc: package api

Permalink

trait DroneControllerBase extends Drone

A drone controller is an object that governs the behaviour of a drone. It exposes a wide range of methods to query the underlying drone's state and give it commands. You can inherit from this class and override the onEvent methods to implement a drone controller with custom behaviour.

NOTE: You should not actually use this class, but one of it's specialisations. In Scala, use DroneController and in Java use JDroneController.

Annotations
@JSExportAll()
Linear Supertypes
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. DroneControllerBase
  2. Drone
  3. AnyRef
  4. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def availableStorage: Int

    Permalink

    Returns the number of free storage capacity.

    Returns the number of free storage capacity.

    Definition Classes
    Drone
  6. def buildDrone(controller: DroneControllerBase, storageModules: Int = 0, missileBatteries: Int = 0, constructors: Int = 0, engines: Int = 0, shieldGenerators: Int = 0): Unit

    Permalink

    Order the drone to start the construction of a new drone.

    Order the drone to start the construction of a new drone. While construction is in progress, the drone cannot move.

    controller

    The drone controller that will govern the behaviour of the new drone.

    storageModules

    The new drone's number of storage modules.

    missileBatteries

    The new drone's number of missile batteries.

    constructors

    The new drone's number of constructors.

    engines

    The new drone's number of engines.

    shieldGenerators

    The new drone's number of shield generators.

  7. def buildDrone(controller: DroneControllerBase, spec: DroneSpec): Unit

    Permalink

    Order the drone to start the construction of a new drone.

    Order the drone to start the construction of a new drone. While construction is in progress, the drone cannot move.

    controller

    The drone controller that will govern the behaviour of the new drone.

    spec

    The specification for the number of copies for each module equipped by the new drone.

  8. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. final def constructors: Int

    Permalink

    Returns the number of constructor modules

    Returns the number of constructor modules

    Definition Classes
    Drone
  10. def displayString: String

    Permalink

    Returns a string that encodes various properties of the drone.

    Returns a string that encodes various properties of the drone.

    Definition Classes
    Drone
  11. final def engines: Int

    Permalink

    Returns the number of engine modules

    Returns the number of engine modules

    Definition Classes
    Drone
  12. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  13. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  14. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  15. def fireMissilesAt(target: Drone): Unit

    Permalink

    Fires all homing missiles at target.

  16. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  17. def giveResourcesTo(otherDrone: Drone): Unit

    Permalink

    Order the drone to give all its resources to otherDrone.

    Order the drone to give all its resources to otherDrone.

    otherDrone

    The drone which will receive the resources.

  18. def halt(): Unit

    Permalink

    Order the drone to stop moving.

  19. def harvest(mineralCrystal: MineralCrystal): Unit

    Permalink

    Order the drone to harvest mineralCrystal.

    Order the drone to harvest mineralCrystal. Must already be close to the position of the mineralCrystal.

  20. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  21. def hitpoints: Int

    Permalink

    Returns the current number of hitpoints, including shields.

    Returns the current number of hitpoints, including shields.

    Definition Classes
    Drone
  22. def isConstructing: Boolean

    Permalink

    Returns true if this drone is currently constructing another drone.

    Returns true if this drone is currently constructing another drone.

    Definition Classes
    Drone
  23. def isDead: Boolean

    Permalink

    Returns true if this drone is dead, false otherwise.

    Returns true if this drone is dead, false otherwise.

    Definition Classes
    Drone
  24. def isEnemy: Boolean

    Permalink

    Always returns false.

    Always returns false.

    Definition Classes
    DroneControllerBaseDrone
  25. def isHarvesting: Boolean

    Permalink

    Returns true if this drone is currently harvesting a mineral.

    Returns true if this drone is currently harvesting a mineral.

    Definition Classes
    Drone
  26. def isInHarvestingRange(mineralCrystal: MineralCrystal): Boolean

    Permalink

    Returns true if mineralCrystal is within harvesting range, otherwise false.

  27. def isInMissileRange(otherDrone: Drone): Boolean

    Permalink

    Returns true if otherDrone is within range of this drones homing missiles, otherwise false.

  28. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  29. def isMoving: Boolean

    Permalink

    Returns true of this drone has a movement command active or queued up, false otherwise.

    Returns true of this drone has a movement command active or queued up, false otherwise.

    Definition Classes
    Drone
  30. def isVisible: Boolean

    Permalink

    Always returns true

    Always returns true

    Definition Classes
    DroneControllerBaseDrone
  31. def lastKnownOrientation: Double

    Permalink

    The orientation of this drone at the last time it was seen by any of your drones.

    The orientation of this drone at the last time it was seen by any of your drones.

    Definition Classes
    DroneControllerBaseDrone
  32. def lastKnownPosition: Vector2

    Permalink

    The position of this drone at the last time it was seen by any of your drones.

    The position of this drone at the last time it was seen by any of your drones.

    Definition Classes
    DroneControllerBaseDrone
  33. final def maxHitpoints: Int

    Permalink

    Returns the amount of hitpoints at full health.

    Returns the amount of hitpoints at full health.

    Definition Classes
    Drone
  34. final def maxSpeed: Double

    Permalink

    Returns the drone's maximum speed.

    Returns the drone's maximum speed.

    Definition Classes
    Drone
  35. def metaController: Option[MetaController]

    Permalink

    When you start the game, this method will be called once on your initial drone controller to give you an opportunity to provide a cwinter.codecraft.core.api.MetaController.

  36. final def missileBatteries: Int

    Permalink

    Returns the number of missile battery modules.

    Returns the number of missile battery modules.

    Definition Classes
    Drone
  37. def missileCooldown: Int

    Permalink

    Returns the drone's homing missile cooldown.

    Returns the drone's homing missile cooldown.

    Definition Classes
    Drone
  38. def moveInDirection(direction: Double): Unit

    Permalink

    Order the drone to keep moving in the direction of direction.

  39. def moveInDirection(directionVector: Vector2): Unit

    Permalink

    Order the drone to keep moving in the direction of directionVector.

  40. def moveTo(position: Vector2): Unit

    Permalink

    Order the drone to move to position.

  41. def moveTo(x: Double, y: Double): Unit

    Permalink

    Order the drone to move to coordinates (x, y).

  42. def moveTo(mineralCrystal: MineralCrystal): Unit

    Permalink

    Order the drone to move towards mineralCrystal.

  43. def moveTo(otherDrone: Drone): Unit

    Permalink

    Order the drone to move towards otherDrone, until it is within 10 units distance of colliding.

  44. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  45. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  46. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  47. def onArrivesAtDrone(drone: Drone): Unit

    Permalink

    Called when this drone arrives at another drone after invoking the moveTo(drone: DroneHandle) command.

  48. def onArrivesAtMineral(mineralCrystal: MineralCrystal): Unit

    Permalink

    Called when this drone arrives at a mineral crystal after invoking the moveTo(mineral: MineralCrystalHandle) command.

  49. def onArrivesAtPosition(): Unit

    Permalink

    Called when this drone arrives a position after invoking the one of the moveTo methods.

  50. def onConstructionCancelled(): Unit

    Permalink

    Called if the drone constructing this drone is destroyed before construction completes.

    Called if the drone constructing this drone is destroyed before construction completes. In such a case, this is the only event function to be called.

  51. def onDeath(): Unit

    Permalink

    Called if the drone is destroyed.

  52. def onDroneEntersVision(drone: Drone): Unit

    Permalink

    Called when another drone enters the sight radius of this drone.

  53. def onMineralEntersVision(mineralCrystal: MineralCrystal): Unit

    Permalink

    Called when a mineral crystal enters the sight radius of this drone.

  54. def onSpawn(): Unit

    Permalink

    Called once when the drone is spawned.

    Called once when the drone is spawned. Called before any other onEvent method is called.

  55. def onTick(): Unit

    Permalink

    Called once every tick, after all other onEvent methods have been called.

  56. def orientation: Double

    Permalink

    Returns the drones orientation in radians.

    Returns the drones orientation in radians.

    Definition Classes
    Drone
  57. def playerID: Int

    Permalink

    Returns the identifier of the player that owns this drone.

    Returns the identifier of the player that owns this drone.

    Definition Classes
    Drone
  58. def position: Vector2

    Permalink

    Returns the drone's position.

    Returns the drone's position.

    Definition Classes
    Drone
  59. final def shieldGenerators: Int

    Permalink

    Returns the number of shield generator modules

    Returns the number of shield generator modules

    Definition Classes
    Drone
  60. def showText(text: String): Unit

    Permalink

    Draws the specified text at the position of the drone on this timestep.

    Draws the specified text at the position of the drone on this timestep.

    Definition Classes
    Drone
  61. final def spec: DroneSpec

    Permalink

    Returns an object that specifies how many copies of each module the drone has.

    Returns an object that specifies how many copies of each module the drone has.

    Definition Classes
    Drone
    Annotations
    @inline()
  62. final def storageModules: Int

    Permalink

    Returns the number of storage modules.

    Returns the number of storage modules.

    Definition Classes
    Drone
  63. def storedResources: Int

    Permalink

    Returns the amount of resources store by this drone.

    Returns the amount of resources store by this drone.

    Definition Classes
    Drone
  64. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  65. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  66. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  67. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  68. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  69. def worldSize: Rectangle

    Permalink

    Returns the confines of the game world.

Deprecated Value Members

  1. def availableRefineries: Int

    Permalink

    Returns 0.

    Returns 0.

    Annotations
    @deprecated
    Deprecated

    (Since version 0.2.4.0) The refinery module has been removed.

  2. def buildDrone(spec: DroneSpec, controller: DroneControllerBase): Unit

    Permalink

    Order the drone to start the construction of a new drone.

    Order the drone to start the construction of a new drone. While construction is in progress, the drone cannot move.

    spec

    The specification for the number of copies for each module equipped by the new drone.

    controller

    The drone controller that will govern the behaviour of the new drone.

    Annotations
    @deprecated
    Deprecated

    (Since version 0.2.4.3) Swap the positions of the spec and controller arguments.

  3. def giveMineralsTo(otherDrone: Drone): Unit

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 0.2.4.3) Use giveResourcesTo instead.

  4. def totalAvailableResources: Int

    Permalink

    Returns the total amount of resources available to this drone.

    Returns the total amount of resources available to this drone. This includes any mineral crystals that are small enough to be processed by this drone.

    Definition Classes
    Drone
    Annotations
    @deprecated
    Deprecated

    (Since version 0.2.4.0) Use storedResources instead.

  5. def weaponsCooldown: Int

    Permalink
    Definition Classes
    Drone
    Annotations
    @deprecated
    Deprecated

    (Since version 0.2.4.3) Use missileCooldown instead.

Inherited from Drone

Inherited from AnyRef

Inherited from Any

Ungrouped