Skip to content

Commit

Permalink
Fix a transferEnergy type error where it suggested a creep. (#258)
Browse files Browse the repository at this point in the history
* No more beaming energy into creeps minds...
  • Loading branch information
InfinityDevTech authored Jul 17, 2024
1 parent 79884ad commit 5a93dc1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
8 changes: 3 additions & 5 deletions dist/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5159,17 +5159,15 @@ interface StructureLink extends OwnedStructure<STRUCTURE_LINK> {
*/
store: Store<RESOURCE_ENERGY, false>;
/**
* Transfer energy from the link to another link or a creep.
* Transfer energy from the link to another link.
*
* If the target is a creep, it has to be at adjacent square to the link.
*
* If the target is a link, it can be at any location in the same room.
* The target link can be at any position within the room.
*
* Remote transfer process implies 3% energy loss and cooldown delay depending on the distance.
* @param target The target object.
* @param amount The amount of energy to be transferred. If omitted, all the available energy is used.
*/
transferEnergy(target: Creep | StructureLink, amount?: number): ScreepsReturnCode;
transferEnergy(target: StructureLink, amount?: number): ScreepsReturnCode;
}

interface StructureLinkConstructor extends _Constructor<StructureLink>, _ConstructorById<StructureLink> {}
Expand Down
8 changes: 3 additions & 5 deletions src/structure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,17 +192,15 @@ interface StructureLink extends OwnedStructure<STRUCTURE_LINK> {
*/
store: Store<RESOURCE_ENERGY, false>;
/**
* Transfer energy from the link to another link or a creep.
* Transfer energy from the link to another link.
*
* If the target is a creep, it has to be at adjacent square to the link.
*
* If the target is a link, it can be at any location in the same room.
* The target link can be at any position within the room.
*
* Remote transfer process implies 3% energy loss and cooldown delay depending on the distance.
* @param target The target object.
* @param amount The amount of energy to be transferred. If omitted, all the available energy is used.
*/
transferEnergy(target: Creep | StructureLink, amount?: number): ScreepsReturnCode;
transferEnergy(target: StructureLink, amount?: number): ScreepsReturnCode;
}

interface StructureLinkConstructor extends _Constructor<StructureLink>, _ConstructorById<StructureLink> {}
Expand Down

0 comments on commit 5a93dc1

Please sign in to comment.