From 11d508a3dae7ae3cb204924f82361dcbb15eb4d2 Mon Sep 17 00:00:00 2001 From: Etienne Samson Date: Sun, 2 Feb 2025 13:46:10 +0100 Subject: [PATCH] Standardize docs on prototypes --- dist/index.d.ts | 34 ++++++++++++++++++++++++++++++++-- src/flag.ts | 5 +++++ src/mineral.ts | 4 +++- src/nuke.ts | 5 +++++ src/resource.ts | 5 +++++ src/ruin.ts | 6 ++++++ src/source.ts | 4 +++- src/structure.ts | 5 +++++ 8 files changed, 64 insertions(+), 4 deletions(-) diff --git a/dist/index.d.ts b/dist/index.d.ts index 235139f1..efa9706c 100644 --- a/dist/index.d.ts +++ b/dist/index.d.ts @@ -1434,6 +1434,11 @@ declare const Deposit: DepositConstructor; * A flag. Flags can be used to mark particular spots in a room. Flags are visible to their owners only. */ interface Flag extends RoomObject { + /** + * The prototype is stored in the {@link Flag.prototype} global object. + * + * You can use it to extend game objects behaviour globally. + */ readonly prototype: Flag; /** @@ -3200,7 +3205,9 @@ declare const Memory: Memory; */ interface Mineral extends RoomObject { /** - * The prototype is stored in the Mineral.prototype global object. You can use it to extend game objects behaviour globally. + * The prototype is stored in the {@link Mineral.prototype} global object. + * + * You can use it to extend game objects behaviour globally. */ readonly prototype: Mineral; /** @@ -3232,6 +3239,11 @@ declare const Mineral: MineralConstructor; * A nuke landing position. This object cannot be removed or modified. You can find incoming nukes in the room using the FIND_NUKES constant. */ interface Nuke extends RoomObject { + /** + * The prototype is stored in the {@link Nuke.prototype} global object. + * + * You can use it to extend game objects behaviour globally. + */ readonly prototype: Nuke; /** @@ -3717,6 +3729,11 @@ declare const RawMemory: RawMemory; */ interface Resource extends RoomObject { + /** + * The prototype is stored in the {@link Resource.prototype} global object. + * + * You can use it to extend game objects behaviour globally. + */ readonly prototype: Resource; /** @@ -4574,6 +4591,12 @@ declare const Room: RoomConstructor; * */ interface Ruin extends RoomObject { + /** + * The prototype is stored in the {@link Ruin.prototype} global object. + * + * You can use it to extend game objects behaviour globally. + */ + readonly prototype: Ruin; /** * A unique object identificator. * You can use {@link Game.getObjectById} method to retrieve an object instance by its id. @@ -4605,7 +4628,9 @@ declare const Ruin: RuinConstructor; */ interface Source extends RoomObject { /** - * The prototype is stored in the Source.prototype global object. You can use it to extend game objects behaviour globally: + * The prototype is stored in the {@link Source.prototype} global object. + * + * You can use it to extend game objects behaviour globally. */ readonly prototype: Source; /** @@ -4905,6 +4930,11 @@ type GenericStore = GenericStoreBase & { [P in ResourceConstant]: number }; * Parent object for structure classes */ interface Structure extends RoomObject { + /** + * The prototype is stored in the {@link Structure.prototype} global object. + * + * You can use it to extend game objects behaviour globally. + */ readonly prototype: Structure; /** diff --git a/src/flag.ts b/src/flag.ts index 705a53ce..319d16fd 100644 --- a/src/flag.ts +++ b/src/flag.ts @@ -2,6 +2,11 @@ * A flag. Flags can be used to mark particular spots in a room. Flags are visible to their owners only. */ interface Flag extends RoomObject { + /** + * The prototype is stored in the {@link Flag.prototype} global object. + * + * You can use it to extend game objects behaviour globally. + */ readonly prototype: Flag; /** diff --git a/src/mineral.ts b/src/mineral.ts index dfebc607..c89409d5 100644 --- a/src/mineral.ts +++ b/src/mineral.ts @@ -4,7 +4,9 @@ */ interface Mineral extends RoomObject { /** - * The prototype is stored in the Mineral.prototype global object. You can use it to extend game objects behaviour globally. + * The prototype is stored in the {@link Mineral.prototype} global object. + * + * You can use it to extend game objects behaviour globally. */ readonly prototype: Mineral; /** diff --git a/src/nuke.ts b/src/nuke.ts index 7a276655..3dfbefae 100644 --- a/src/nuke.ts +++ b/src/nuke.ts @@ -2,6 +2,11 @@ * A nuke landing position. This object cannot be removed or modified. You can find incoming nukes in the room using the FIND_NUKES constant. */ interface Nuke extends RoomObject { + /** + * The prototype is stored in the {@link Nuke.prototype} global object. + * + * You can use it to extend game objects behaviour globally. + */ readonly prototype: Nuke; /** diff --git a/src/resource.ts b/src/resource.ts index 059b31da..d3839a71 100644 --- a/src/resource.ts +++ b/src/resource.ts @@ -3,6 +3,11 @@ */ interface Resource extends RoomObject { + /** + * The prototype is stored in the {@link Resource.prototype} global object. + * + * You can use it to extend game objects behaviour globally. + */ readonly prototype: Resource; /** diff --git a/src/ruin.ts b/src/ruin.ts index 8d96206f..84ec6703 100644 --- a/src/ruin.ts +++ b/src/ruin.ts @@ -5,6 +5,12 @@ * */ interface Ruin extends RoomObject { + /** + * The prototype is stored in the {@link Ruin.prototype} global object. + * + * You can use it to extend game objects behaviour globally. + */ + readonly prototype: Ruin; /** * A unique object identificator. * You can use {@link Game.getObjectById} method to retrieve an object instance by its id. diff --git a/src/source.ts b/src/source.ts index 1a253420..02e83963 100644 --- a/src/source.ts +++ b/src/source.ts @@ -3,7 +3,9 @@ */ interface Source extends RoomObject { /** - * The prototype is stored in the Source.prototype global object. You can use it to extend game objects behaviour globally: + * The prototype is stored in the {@link Source.prototype} global object. + * + * You can use it to extend game objects behaviour globally. */ readonly prototype: Source; /** diff --git a/src/structure.ts b/src/structure.ts index 966a85cf..6fac03c6 100644 --- a/src/structure.ts +++ b/src/structure.ts @@ -2,6 +2,11 @@ * Parent object for structure classes */ interface Structure extends RoomObject { + /** + * The prototype is stored in the {@link Structure.prototype} global object. + * + * You can use it to extend game objects behaviour globally. + */ readonly prototype: Structure; /**