README

Kaida-Amethyst/screeps/raw does not have a README file

#
JsConstructionSite

#external
pub type JsConstructionSite

Screeps Arena raw 层的原始 ConstructionSite 对象类型。

#
JsConstructionSite::my

#
JsConstructionSite::progress

#
JsConstructionSite::progress_total

#
JsConstructionSite::remove_raw

fn JsConstructionSite::remove_raw(self : JsConstructionSite) -> Unit

#
JsConstructionSite::to_game_object

fn JsConstructionSite::to_game_object(self : JsConstructionSite) -> JsGameObject

#
JsCreateConstructionSiteResult

#external
pub type JsCreateConstructionSiteResult

Screeps Arena raw 层的原始 construction site 创建结果对象类型。

#
JsCreateConstructionSiteResult::error

#
JsCreep

#external
pub type JsCreep

Screeps Arena raw 层的原始 Creep 对象类型。

#
JsCreep::attack_raw

fn JsCreep::attack_raw(self : JsCreep, target : JsGameObject) -> Int

#
JsCreep::body

fn JsCreep::body(self : JsCreep) -> Array[JsCreepBodyPart]

#
JsCreep::build_raw

fn JsCreep::build_raw(self : JsCreep, target : JsConstructionSite) -> Int

#
JsCreep::harvest_raw

fn JsCreep::harvest_raw(self : JsCreep, target : JsSource) -> Int

#
JsCreep::heal_raw

fn JsCreep::heal_raw(self : JsCreep, target : JsGameObject) -> Int

#
JsCreep::hits

fn JsCreep::hits(self : JsCreep) -> Int

#
JsCreep::hits_max

fn JsCreep::hits_max(self : JsCreep) -> Int

#
JsCreep::move_to_raw

fn JsCreep::move_to_raw(self : JsCreep, target : JsGameObject) -> Int

#
JsCreep::my

fn JsCreep::my(self : JsCreep) -> Bool

#
JsCreep::ranged_attack_raw

fn JsCreep::ranged_attack_raw(self : JsCreep, target : JsGameObject) -> Int

#
JsCreep::spawning

fn JsCreep::spawning(self : JsCreep) -> Bool

#
JsCreep::store

fn JsCreep::store(self : JsCreep) -> JsStore

#
JsCreep::to_game_object

fn JsCreep::to_game_object(self : JsCreep) -> JsGameObject

raw extern type 之间允许做零成本的 JS 句柄转换。

#
JsCreep::transfer_raw

fn JsCreep::transfer_raw(self : JsCreep, target : JsGameObject, resource : String) -> Int

#
JsCreep::withdraw_raw

fn JsCreep::withdraw_raw(self : JsCreep, target : JsGameObject, resource : String) -> Int

#
JsCreepBodyPart

#external
pub type JsCreepBodyPart

Screeps Arena raw 层的原始 creep body part 对象类型。

#
JsCreepBodyPart::hits

fn JsCreepBodyPart::hits(self : JsCreepBodyPart) -> Int

#
JsCreepBodyPart::kind

fn JsCreepBodyPart::kind(self : JsCreepBodyPart) -> String

#
JsFlag

#external
pub type JsFlag

Screeps Arena raw 层的原始 Flag 对象类型。

#
JsFlag::my

#
JsFlag::to_game_object

fn JsFlag::to_game_object(self : JsFlag) -> JsGameObject

#
JsGameObject

#external
pub type JsGameObject

Screeps Arena raw 层的原始 JS 对象类型。

#
JsGameObject::exists

fn JsGameObject::exists(self : JsGameObject) -> Bool

#
JsGameObject::find_closest_by_path_raw

fn JsGameObject::find_closest_by_path_raw(self : JsGameObject, candidates : Array[JsGameObject]) ->
Nullish
[JsGameObject]

#
JsGameObject::find_closest_by_range_raw

fn JsGameObject::find_closest_by_range_raw(self : JsGameObject, candidates : Array[JsGameObject]) ->
Nullish
[JsGameObject]

#
JsGameObject::find_in_range_raw

fn JsGameObject::find_in_range_raw(self : JsGameObject, candidates : Array[JsGameObject], range : Int) -> Array[JsGameObject]

#
JsGameObject::get_range_to_raw

fn JsGameObject::get_range_to_raw(self : JsGameObject, target : JsGameObject) -> Int

#
JsGameObject::hits

#
JsGameObject::hits_max

#
JsGameObject::id

fn JsGameObject::id(self : JsGameObject) -> String

id 在 typings 中可能是 number | string,formal API 统一转成字符串。

#
JsGameObject::is_structure

fn JsGameObject::is_structure(self : JsGameObject) -> Bool

#
JsGameObject::my

#
JsGameObject::prototype_name

fn JsGameObject::prototype_name(self : JsGameObject) -> String

#
JsGameObject::to_construction_site

fn JsGameObject::to_construction_site(self : JsGameObject) -> JsConstructionSite

#
JsGameObject::to_creep

fn JsGameObject::to_creep(self : JsGameObject) -> JsCreep

#
JsGameObject::to_flag

fn JsGameObject::to_flag(self : JsGameObject) -> JsFlag

#
JsGameObject::to_source

fn JsGameObject::to_source(self : JsGameObject) -> JsSource

#
JsGameObject::to_structure_container

fn JsGameObject::to_structure_container(self : JsGameObject) -> JsStructureContainer

#
JsGameObject::to_structure_spawn

fn JsGameObject::to_structure_spawn(self : JsGameObject) -> JsStructureSpawn

#
JsGameObject::to_structure_tower

fn JsGameObject::to_structure_tower(self : JsGameObject) -> JsStructureTower

#
JsGameObject::x

fn JsGameObject::x(self : JsGameObject) -> Int

#
JsGameObject::y

fn JsGameObject::y(self : JsGameObject) -> Int

#
JsSource

#external
pub type JsSource

Screeps Arena raw 层的原始 Source 对象类型。

#
JsSource::energy

fn JsSource::energy(self : JsSource) -> Int

#
JsSource::energy_capacity

fn JsSource::energy_capacity(self : JsSource) -> Int

#
JsSource::to_game_object

fn JsSource::to_game_object(self : JsSource) -> JsGameObject

#
JsSpawnCreepResult

#external
pub type JsSpawnCreepResult

Screeps Arena raw 层的原始 spawn 结果对象类型。

#
JsSpawnCreepResult::error

#
JsSpawnCreepResult::object

#
JsSpawning

#external
pub type JsSpawning

Screeps Arena raw 层的原始 spawning 对象类型。

#
JsSpawning::creep

fn JsSpawning::creep(self : JsSpawning) -> JsCreep

#
JsSpawning::need_time

fn JsSpawning::need_time(self : JsSpawning) -> Int

#
JsSpawning::remaining_time

fn JsSpawning::remaining_time(self : JsSpawning) -> Int

#
JsStore

#external
pub type JsStore

Screeps Arena raw 层的原始 Store 对象类型。

#
JsStore::get_capacity

fn JsStore::get_capacity(self : JsStore) ->
Nullish
[Int]

#
JsStore::get_capacity_by

fn JsStore::get_capacity_by(self : JsStore, resource : String) ->
Nullish
[Int]

#
JsStore::get_free_capacity

fn JsStore::get_free_capacity(self : JsStore) ->
Nullish
[Int]

#
JsStore::get_free_capacity_by

fn JsStore::get_free_capacity_by(self : JsStore, resource : String) ->
Nullish
[Int]

#
JsStore::get_used_capacity

fn JsStore::get_used_capacity(self : JsStore) ->
Nullish
[Int]

#
JsStore::get_used_capacity_by

fn JsStore::get_used_capacity_by(self : JsStore, resource : String) ->
Nullish
[Int]

#
JsStore::resource_amount

fn JsStore::resource_amount(self : JsStore, resource : String) -> Int

#
JsStructureContainer

#external
pub type JsStructureContainer

Screeps Arena raw 层的原始 StructureContainer 对象类型。

#
JsStructureContainer::hits

#
JsStructureContainer::hits_max

fn JsStructureContainer::hits_max(self : JsStructureContainer) -> Int

#
JsStructureContainer::my

#
JsStructureContainer::store

#
JsStructureContainer::to_game_object

#
JsStructureSpawn

#external
pub type JsStructureSpawn

Screeps Arena raw 层的原始 StructureSpawn 对象类型。

#
JsStructureSpawn::hits

fn JsStructureSpawn::hits(self : JsStructureSpawn) -> Int

#
JsStructureSpawn::hits_max

fn JsStructureSpawn::hits_max(self : JsStructureSpawn) -> Int

#
JsStructureSpawn::my

#
JsStructureSpawn::spawn_creep_raw

fn JsStructureSpawn::spawn_creep_raw(self : JsStructureSpawn, body : Array[String]) -> JsSpawnCreepResult

#
JsStructureSpawn::spawning

#
JsStructureSpawn::store

#
JsStructureSpawn::to_game_object

fn JsStructureSpawn::to_game_object(self : JsStructureSpawn) -> JsGameObject

#
JsStructureTower

#external
pub type JsStructureTower

Screeps Arena raw 层的原始 StructureTower 对象类型。

#
JsStructureTower::attack_raw

fn JsStructureTower::attack_raw(self : JsStructureTower, target : JsGameObject) -> Int

#
JsStructureTower::cooldown

fn JsStructureTower::cooldown(self : JsStructureTower) -> Int

#
JsStructureTower::heal_raw

fn JsStructureTower::heal_raw(self : JsStructureTower, target : JsGameObject) -> Int

#
JsStructureTower::hits

fn JsStructureTower::hits(self : JsStructureTower) -> Int

#
JsStructureTower::hits_max

fn JsStructureTower::hits_max(self : JsStructureTower) -> Int

#
JsStructureTower::my

#
JsStructureTower::store

#
JsStructureTower::to_game_object

fn JsStructureTower::to_game_object(self : JsStructureTower) -> JsGameObject

#
BODY_PART_ATTACK

let BODY_PART_ATTACK : String

#
BODY_PART_CARRY

let BODY_PART_CARRY : String

#
BODY_PART_HEAL

let BODY_PART_HEAL : String

#
BODY_PART_MOVE

let BODY_PART_MOVE : String

raw 层保留官方 body part 的原始字符串常量。

#
BODY_PART_RANGED_ATTACK

let BODY_PART_RANGED_ATTACK : String

#
BODY_PART_TOUGH

let BODY_PART_TOUGH : String

#
BODY_PART_WORK

let BODY_PART_WORK : String

#
ERR_BUSY

let ERR_BUSY : Int

#
ERR_FULL

let ERR_FULL : Int

#
ERR_INVALID_ARGS

let ERR_INVALID_ARGS : Int

#
ERR_INVALID_TARGET

let ERR_INVALID_TARGET : Int

#
ERR_NOT_ENOUGH_ENERGY

let ERR_NOT_ENOUGH_ENERGY : Int

#
ERR_NOT_ENOUGH_RESOURCES

let ERR_NOT_ENOUGH_RESOURCES : Int

#
ERR_NOT_IN_RANGE

let ERR_NOT_IN_RANGE : Int

#
ERR_NOT_OWNER

let ERR_NOT_OWNER : Int

#
ERR_NO_BODYPART

let ERR_NO_BODYPART : Int

#
ERR_TIRED

let ERR_TIRED : Int

#
OK_CODE

let OK_CODE : Int

raw 层保留官方错误码常量,供高层接口映射为 ActionResult

#
RESOURCE_ENERGY

let RESOURCE_ENERGY : String

raw 层保留官方资源类型的原始字符串常量。

#
construction_sites

fn construction_sites() -> Array[JsConstructionSite]

#
containers

fn containers() -> Array[JsStructureContainer]

#
create_construction_site_by_name

fn create_construction_site_by_name(x : Int, y : Int, name : String) -> JsCreateConstructionSiteResult

#
creeps

fn creeps() -> Array[JsCreep]

#
flags

fn flags() -> Array[JsFlag]

#
get_object_by_id

fn get_object_by_id(id : String) -> JsGameObject?

#
get_objects

fn get_objects() -> Array[JsGameObject]

获取当前游戏中的全部对象。

#
get_ticks

fn get_ticks() -> Int

直接调用官方 getTicks

#
sources

fn sources() -> Array[JsSource]

#
spawns

fn spawns() -> Array[JsStructureSpawn]

#
structures

fn structures() -> Array[JsGameObject]

#
towers

fn towers() -> Array[JsStructureTower]