Class/Object

cwinter.codecraft.core.api

JSDroneController

Related Docs: object JSDroneController | package api

Permalink

class JSDroneController extends DroneControllerBase

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

Instance Constructors

  1. new JSDroneController(droneControllerProvider: (String) ⇒ DroneControllerBase, _errorHandler: Option[(Throwable, String, JSDroneController) ⇒ Unit] = None, _nativeControllerName: String = "")

    Permalink

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. def alliesInSight: Array[Drone]

    Permalink

    Gets all allied drones currently within the sight radius of this drone.

    Gets all allied drones currently within the sight radius of this drone.

    Annotations
    @JSExport()
  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def availableStorage: Int

    Permalink

    Returns the number of free storage capacity.

    Returns the number of free storage capacity.

    Definition Classes
    Drone
  7. def buildDrone(controllerName: String, spec: Dynamic): Unit

    Permalink
    Annotations
    @JSExport()
  8. 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.

    Definition Classes
    DroneControllerBase
  9. 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.

    Definition Classes
    DroneControllerBase
  10. def clone(): AnyRef

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

    Permalink

    Returns the number of constructor modules

    Returns the number of constructor modules

    Definition Classes
    Drone
  12. def controllerName: String

    Permalink
  13. 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
  14. val droneControllerProvider: (String) ⇒ DroneControllerBase

    Permalink
  15. def dronesInSight: Array[Drone]

    Permalink

    Gets all drones currently within the sight radius of this drone.

    Gets all drones currently within the sight radius of this drone.

    Annotations
    @JSExport()
  16. def enemiesInSight: Array[Drone]

    Permalink

    Gets all enemy drones currently within the sight radius of this drone.

    Gets all enemy drones currently within the sight radius of this drone.

    Annotations
    @JSExport()
  17. final def engines: Int

    Permalink

    Returns the number of engine modules

    Returns the number of engine modules

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  20. def errorHandler_=(value: (Throwable, String, JSDroneController) ⇒ Unit): Unit

    Permalink
  21. def finalize(): Unit

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

    Permalink

    Fires all homing missiles at target.

    Fires all homing missiles at target.

    Definition Classes
    DroneControllerBase
  23. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  24. 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.

    Definition Classes
    DroneControllerBase
  25. def halt(): Unit

    Permalink

    Order the drone to stop moving.

    Order the drone to stop moving.

    Definition Classes
    DroneControllerBase
  26. 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.

    Definition Classes
    DroneControllerBase
  27. def hashCode(): Int

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

    Permalink

    Returns the current number of hitpoints, including shields.

    Returns the current number of hitpoints, including shields.

    Definition Classes
    Drone
  29. 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
  30. 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
  31. def isEnemy: Boolean

    Permalink

    Always returns false.

    Always returns false.

    Definition Classes
    DroneControllerBaseDrone
  32. 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
  33. def isInHarvestingRange(mineralCrystal: MineralCrystal): Boolean

    Permalink

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

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

    Definition Classes
    DroneControllerBase
  34. def isInMissileRange(otherDrone: Drone): Boolean

    Permalink

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

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

    Definition Classes
    DroneControllerBase
  35. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  36. 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
  37. def isVisible: Boolean

    Permalink

    Always returns true

    Always returns true

    Definition Classes
    DroneControllerBaseDrone
  38. 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
  39. 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
  40. final def maxHitpoints: Int

    Permalink

    Returns the amount of hitpoints at full health.

    Returns the amount of hitpoints at full health.

    Definition Classes
    Drone
  41. final def maxSpeed: Double

    Permalink

    Returns the drone's maximum speed.

    Returns the drone's maximum speed.

    Definition Classes
    Drone
  42. 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.

    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.

    Definition Classes
    DroneControllerBase
  43. final def missileBatteries: Int

    Permalink

    Returns the number of missile battery modules.

    Returns the number of missile battery modules.

    Definition Classes
    Drone
  44. def missileCooldown: Int

    Permalink

    Returns the drone's homing missile cooldown.

    Returns the drone's homing missile cooldown.

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

    Permalink

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

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

    Definition Classes
    DroneControllerBase
  46. def moveInDirection(directionVector: Vector2): Unit

    Permalink

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

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

    Definition Classes
    DroneControllerBase
  47. def moveTo(position: Vector2): Unit

    Permalink

    Order the drone to move to position.

    Order the drone to move to position.

    Definition Classes
    DroneControllerBase
  48. def moveTo(x: Double, y: Double): Unit

    Permalink

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

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

    Definition Classes
    DroneControllerBase
  49. def moveTo(mineralCrystal: MineralCrystal): Unit

    Permalink

    Order the drone to move towards mineralCrystal.

    Order the drone to move towards mineralCrystal.

    Definition Classes
    DroneControllerBase
  50. def moveTo(otherDrone: Drone): Unit

    Permalink

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

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

    Definition Classes
    DroneControllerBase
  51. def nativeController: Dynamic

    Permalink
  52. final def ne(arg0: AnyRef): Boolean

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

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

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

    Permalink

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

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

    Definition Classes
    JSDroneControllerDroneControllerBase
  56. def onArrivesAtMineral(mineralCrystal: MineralCrystal): Unit

    Permalink

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

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

    Definition Classes
    JSDroneControllerDroneControllerBase
  57. def onArrivesAtPosition(): Unit

    Permalink

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

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

    Definition Classes
    JSDroneControllerDroneControllerBase
  58. 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.

    Definition Classes
    DroneControllerBase
  59. def onDeath(): Unit

    Permalink

    Called if the drone is destroyed.

    Called if the drone is destroyed.

    Definition Classes
    JSDroneControllerDroneControllerBase
  60. def onDroneEntersVision(drone: Drone): Unit

    Permalink

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

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

    Definition Classes
    JSDroneControllerDroneControllerBase
  61. def onMineralEntersVision(mineralCrystal: MineralCrystal): Unit

    Permalink

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

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

    Definition Classes
    JSDroneControllerDroneControllerBase
  62. 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.

    Definition Classes
    JSDroneControllerDroneControllerBase
  63. def onTick(): Unit

    Permalink

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

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

    Definition Classes
    JSDroneControllerDroneControllerBase
  64. def orientation: Double

    Permalink

    Returns the drones orientation in radians.

    Returns the drones orientation in radians.

    Definition Classes
    Drone
  65. 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
  66. def position: Vector2

    Permalink

    Returns the drone's position.

    Returns the drone's position.

    Definition Classes
    Drone
  67. def setPreEventProcessingHook(value: () ⇒ Unit): Unit

    Permalink
  68. final def shieldGenerators: Int

    Permalink

    Returns the number of shield generator modules

    Returns the number of shield generator modules

    Definition Classes
    Drone
  69. 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
  70. 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()
  71. final def storageModules: Int

    Permalink

    Returns the number of storage modules.

    Returns the number of storage modules.

    Definition Classes
    Drone
  72. 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
  73. final def synchronized[T0](arg0: ⇒ T0): T0

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

    Permalink
    Definition Classes
    AnyRef → Any
  75. def updateController(controller: Dynamic, controllerName: String): Unit

    Permalink
  76. final def wait(): Unit

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

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

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

    Permalink

    Returns the confines of the game world.

    Returns the confines of the game world.

    Definition Classes
    DroneControllerBase

Deprecated Value Members

  1. def availableRefineries: Int

    Permalink

    Returns 0.

    Returns 0.

    Definition Classes
    DroneControllerBase
    Annotations
    @deprecated
    Deprecated

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

  2. def buildDrone(controller: JSDroneController, spec: Dynamic): Unit

    Permalink
    Annotations
    @JSExport() @deprecated
    Deprecated

    (Since version 0.11.1.0) Use buildDrone(controllerName: String, spec: js.Dynamic).

  3. 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.

    Definition Classes
    DroneControllerBase
    Annotations
    @deprecated
    Deprecated

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

  4. def giveMineralsTo(otherDrone: Drone): Unit

    Permalink
    Definition Classes
    DroneControllerBase
    Annotations
    @deprecated
    Deprecated

    (Since version 0.2.4.3) Use giveResourcesTo instead.

  5. def storedMinerals: Array[MineralCrystal]

    Permalink

    Gets all mineral crystals stored by this drone.

    Gets all mineral crystals stored by this drone.

    Annotations
    @JSExport() @deprecated
    Deprecated

    (Since version 0.2.4.0) Drones do not store mineral crystals anymore, only resources.

  6. 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.

  7. def weaponsCooldown: Int

    Permalink
    Definition Classes
    Drone
    Annotations
    @deprecated
    Deprecated

    (Since version 0.2.4.3) Use missileCooldown instead.

Inherited from DroneControllerBase

Inherited from Drone

Inherited from AnyRef

Inherited from Any

Ungrouped