Skip to content

Commit

Permalink
docs: #3132 Update all Markdown comment symbol links to {@apilink} (#…
Browse files Browse the repository at this point in the history
…3137)

Used the following setup to search for and replace the Markdown comments:
Search: `\[\[([a-zA-Z 0-9._]*)\|([a-zA-Z 0-9._]*)\]\]` and `\[\[([a-zA-Z 0-9._]*)\]\]`
Replace: `{@apilink $1 | `$2`}` and `{@apilink $1}`

I wasn't sure if all the "normal" comments had to be replaced as wel, because `src/engine/Actions/ActionContext.ts` contains both `{@apilink Action}` and `[[EasingFunctions]]`. It's easy to do with a small modification, so give me a shout if that's preferred.

Closes #3132
  • Loading branch information
Autsider666 authored Jul 24, 2024
1 parent d68740e commit 2f4360d
Show file tree
Hide file tree
Showing 80 changed files with 389 additions and 389 deletions.
2 changes: 1 addition & 1 deletion src/engine/Actions/Action.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Entity } from '../EntityComponentSystem/Entity';

/**
* Used for implementing actions for the [[ActionContext|Action API]].
* Used for implementing actions for the {@apilink ActionContext | `Action API`}.
*/
export interface Action {
id: number;
Expand Down
2 changes: 1 addition & 1 deletion src/engine/Actions/Action/ActionSequence.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ActionQueue } from '../ActionQueue';

/**
* Action that can represent a sequence of actions, this can be useful in conjunction with
* [[ParallelActions]] to run multiple sequences in parallel.
* {@apilink ParallelActions} to run multiple sequences in parallel.
*/
export class ActionSequence implements Action {
id = nextActionId();
Expand Down
2 changes: 1 addition & 1 deletion src/engine/Actions/Action/ParallelActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Entity } from '../../EntityComponentSystem';
import { Action, nextActionId } from '../Action';

/**
* Action that can run multiple [[Action]]s or [[ActionSequence]]s at the same time
* Action that can run multiple {@apilink Action}s or {@apilink ActionSequence}s at the same time
*/
export class ParallelActions implements Action {
id = nextActionId();
Expand Down
20 changes: 10 additions & 10 deletions src/engine/Actions/ActionContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,21 +61,21 @@ export class ActionContext {

/**
* This method will move an actor to the specified `x` and `y` position over the
* specified duration using a given [[EasingFunctions]] and return back the actor. This
* specified duration using a given {@apilink EasingFunctions} and return back the actor. This
* method is part of the actor 'Action' fluent API allowing action chaining.
* @param pos The x,y vector location to move the actor to
* @param duration The time it should take the actor to move to the new location in milliseconds
* @param easingFcn Use [[EasingFunction]] or a custom function to use to calculate position, Default is [[EasingFunctions.Linear]]
* @param easingFcn Use {@apilink EasingFunction} or a custom function to use to calculate position, Default is {@apilink EasingFunctions.Linear}
*/
public easeTo(pos: Vector, duration: number, easingFcn?: EasingFunction): ActionContext;
/**
* This method will move an actor to the specified `x` and `y` position over the
* specified duration using a given [[EasingFunctions]] and return back the actor. This
* specified duration using a given {@apilink EasingFunctions} and return back the actor. This
* method is part of the actor 'Action' fluent API allowing action chaining.
* @param x The x location to move the actor to
* @param y The y location to move the actor to
* @param duration The time it should take the actor to move to the new location in milliseconds
* @param easingFcn Use [[EasingFunction]] or a custom function to use to calculate position, Default is [[EasingFunctions.Linear]]
* @param easingFcn Use {@apilink EasingFunction} or a custom function to use to calculate position, Default is {@apilink EasingFunctions.Linear}
*/
public easeTo(x: number, y: number, duration: number, easingFcn?: EasingFunction): ActionContext;
public easeTo(...args: any[]): ActionContext {
Expand All @@ -101,18 +101,18 @@ export class ActionContext {

/**
* This method will move an actor by a specified vector offset relative to the current position given
* a duration and a [[EasingFunction]]. This method is part of the actor 'Action' fluent API allowing action chaining.
* a duration and a {@apilink EasingFunction}. This method is part of the actor 'Action' fluent API allowing action chaining.
* @param offset Vector offset relative to the current position
* @param duration The duration in milliseconds
* @param easingFcn Use [[EasingFunction]] or a custom function to use to calculate position, Default is [[EasingFunctions.Linear]]
* @param easingFcn Use {@apilink EasingFunction} or a custom function to use to calculate position, Default is {@apilink EasingFunctions.Linear}
*/
public easeBy(offset: Vector, duration: number, easingFcn?: EasingFunction): ActionContext;
/**
* This method will move an actor by a specified x and y offset relative to the current position given
* a duration and a [[EasingFunction]]. This method is part of the actor 'Action' fluent API allowing action chaining.
* a duration and a {@apilink EasingFunction}. This method is part of the actor 'Action' fluent API allowing action chaining.
* @param offset Vector offset relative to the current position
* @param duration The duration in milliseconds
* @param easingFcn Use [[EasingFunction]] or a custom function to use to calculate position, Default is [[EasingFunctions.Linear]]
* @param easingFcn Use {@apilink EasingFunction} or a custom function to use to calculate position, Default is {@apilink EasingFunctions.Linear}
*/
public easeBy(offsetX: number, offsetY: number, duration: number, easingFcn?: EasingFunction): ActionContext;
public easeBy(...args: any[]): ActionContext {
Expand Down Expand Up @@ -202,7 +202,7 @@ export class ActionContext {
* method is part of the actor 'Action' fluent API allowing action chaining.
* @param angleRadians The angle to rotate to in radians
* @param speed The angular velocity of the rotation specified in radians per second
* @param rotationType The [[RotationType]] to use for this rotation
* @param rotationType The {@apilink RotationType} to use for this rotation
*/
public rotateTo(angleRadians: number, speed: number, rotationType?: RotationType): ActionContext {
this._queue.add(new RotateTo(this._entity, angleRadians, speed, rotationType));
Expand All @@ -215,7 +215,7 @@ export class ActionContext {
* of the actor 'Action' fluent API allowing action chaining.
* @param angleRadiansOffset The angle to rotate to in radians relative to the current rotation
* @param speed The speed in radians/sec the actor should rotate at
* @param rotationType The [[RotationType]] to use for this rotation, default is shortest path
* @param rotationType The {@apilink RotationType} to use for this rotation, default is shortest path
*/
public rotateBy(angleRadiansOffset: number, speed: number, rotationType?: RotationType): ActionContext {
this._queue.add(new RotateBy(this._entity, angleRadiansOffset, speed, rotationType));
Expand Down
6 changes: 3 additions & 3 deletions src/engine/Actions/ActionQueue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import { Action } from './Action';
/**
* Action Queues represent an ordered sequence of actions
*
* Action queues are part of the [[ActionContext|Action API]] and
* store the list of actions to be executed for an [[Actor]].
* Action queues are part of the {@apilink ActionContext | `Action API`} and
* store the list of actions to be executed for an {@apilink Actor}.
*
* Actors implement [[Actor.actions]] which can be manipulated by
* Actors implement {@apilink Actor.actions} which can be manipulated by
* advanced users to adjust the actions currently being executed in the
* queue.
*/
Expand Down
12 changes: 6 additions & 6 deletions src/engine/Actions/ActionsComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,21 +66,21 @@ export class ActionsComponent extends Component implements ActionContextMethods

/**
* This method will move an actor to the specified `x` and `y` position over the
* specified duration using a given [[EasingFunctions]] and return back the actor. This
* specified duration using a given {@apilink EasingFunctions} and return back the actor. This
* method is part of the actor 'Action' fluent API allowing action chaining.
* @param pos The x,y vector location to move the actor to
* @param duration The time it should take the actor to move to the new location in milliseconds
* @param easingFcn Use [[EasingFunctions]] or a custom function to use to calculate position, Default is [[EasingFunctions.Linear]]
* @param easingFcn Use {@apilink EasingFunctions} or a custom function to use to calculate position, Default is {@apilink EasingFunctions.Linear}
*/
public easeTo(pos: Vector, duration: number, easingFcn?: EasingFunction): ActionContext;
/**
* This method will move an actor to the specified `x` and `y` position over the
* specified duration using a given [[EasingFunctions]] and return back the actor. This
* specified duration using a given {@apilink EasingFunctions} and return back the actor. This
* method is part of the actor 'Action' fluent API allowing action chaining.
* @param x The x location to move the actor to
* @param y The y location to move the actor to
* @param duration The time it should take the actor to move to the new location in milliseconds
* @param easingFcn Use [[EasingFunctions]] or a custom function to use to calculate position, Default is [[EasingFunctions.Linear]]
* @param easingFcn Use {@apilink EasingFunctions} or a custom function to use to calculate position, Default is {@apilink EasingFunctions.Linear}
*/
public easeTo(x: number, y: number, duration: number, easingFcn?: EasingFunction): ActionContext;
public easeTo(...args: any[]): ActionContext {
Expand Down Expand Up @@ -139,7 +139,7 @@ export class ActionsComponent extends Component implements ActionContextMethods
* method is part of the actor 'Action' fluent API allowing action chaining.
* @param angleRadians The angle to rotate to in radians
* @param speed The angular velocity of the rotation specified in radians per second
* @param rotationType The [[RotationType]] to use for this rotation
* @param rotationType The {@apilink RotationType} to use for this rotation
*/
public rotateTo(angleRadians: number, speed: number, rotationType?: RotationType): ActionContext {
return this._getCtx().rotateTo(angleRadians, speed, rotationType);
Expand All @@ -151,7 +151,7 @@ export class ActionsComponent extends Component implements ActionContextMethods
* of the actor 'Action' fluent API allowing action chaining.
* @param angleRadiansOffset The angle to rotate to in radians relative to the current rotation
* @param speed The speed in radians/sec the actor should rotate at
* @param rotationType The [[RotationType]] to use for this rotation, default is shortest path
* @param rotationType The {@apilink RotationType} to use for this rotation, default is shortest path
*/
public rotateBy(angleRadiansOffset: number, speed: number, rotationType?: RotationType): ActionContext {
return this._getCtx().rotateBy(angleRadiansOffset, speed, rotationType);
Expand Down
42 changes: 21 additions & 21 deletions src/engine/Actor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export type ActorArgs = ColliderArgs & {
*/
pos?: Vector;
/**
* Optionally set the coordinate plane of the actor, default is [[CoordPlane.World]] meaning actor is subject to camera positioning
* Optionally set the coordinate plane of the actor, default is {@apilink CoordPlane.World} meaning actor is subject to camera positioning
*/
coordPlane?: CoordPlane;
/**
Expand Down Expand Up @@ -132,7 +132,7 @@ export type ActorArgs = ColliderArgs & {
collisionType?: CollisionType;

/**
* Optionally supply a [[CollisionGroup]]
* Optionally supply a {@apilink CollisionGroup}
*/
collisionGroup?: CollisionGroup;
};
Expand Down Expand Up @@ -243,7 +243,7 @@ export const ActorEvents = {
* The most important primitive in Excalibur is an `Actor`. Anything that
* can move on the screen, collide with another `Actor`, respond to events,
* or interact with the current scene, must be an actor. An `Actor` **must**
* be part of a [[Scene]] for it to be drawn to the screen.
* be part of a {@apilink Scene} for it to be drawn to the screen.
*/
export class Actor extends Entity implements Eventable, PointerEvents, CanInitialize, CanUpdate, CanBeKilled {
public events = new EventEmitter<ActorEvents>();
Expand All @@ -263,35 +263,35 @@ export class Actor extends Entity implements Eventable, PointerEvents, CanInitia
public body: BodyComponent;

/**
* Access the Actor's built in [[TransformComponent]]
* Access the Actor's built in {@apilink TransformComponent}
*/
public transform: TransformComponent;

/**
* Access the Actor's built in [[MotionComponent]]
* Access the Actor's built in {@apilink MotionComponent}
*/
public motion: MotionComponent;

/**
* Access to the Actor's built in [[GraphicsComponent]]
* Access to the Actor's built in {@apilink GraphicsComponent}
*/
public graphics: GraphicsComponent;

/**
* Access to the Actor's built in [[ColliderComponent]]
* Access to the Actor's built in {@apilink ColliderComponent}
*/
public collider: ColliderComponent;

/**
* Access to the Actor's built in [[PointerComponent]] config
* Access to the Actor's built in {@apilink PointerComponent} config
*/
public pointer: PointerComponent;

/**
* Useful for quickly scripting actor behavior, like moving to a place, patrolling back and forth, blinking, etc.
*
* Access to the Actor's built in [[ActionsComponent]] which forwards to the
* [[ActionContext|Action context]] of the actor.
* Access to the Actor's built in {@apilink ActionsComponent} which forwards to the
* {@apilink ActionContext | `Action context`} of the actor.
*/
public actions: ActionsComponent;

Expand Down Expand Up @@ -374,14 +374,14 @@ export class Actor extends Entity implements Eventable, PointerEvents, CanInitia
}

/**
* Sets the acceleration of the actor from the last frame. This does not include the global acc [[Physics.acc]].
* Sets the acceleration of the actor from the last frame. This does not include the global acc {@apilink Physics.acc}.
*/
public set oldAcc(theAcc: Vector) {
this.body.oldAcc.setTo(theAcc.x, theAcc.y);
}

/**
* Gets the acceleration of the actor from the last frame. This does not include the global acc [[Physics.acc]].
* Gets the acceleration of the actor from the last frame. This does not include the global acc {@apilink Physics.acc}.
*/
public get oldAcc(): Vector {
return this.body.oldAcc;
Expand Down Expand Up @@ -753,7 +753,7 @@ export class Actor extends Entity implements Eventable, PointerEvents, CanInitia
/**
* It is not recommended that internal excalibur methods be overridden, do so at your own risk.
*
* Internal _prekill handler for [[onPreKill]] lifecycle event
* Internal _prekill handler for {@apilink onPreKill} lifecycle event
* @internal
*/
public _prekill(scene: Scene) {
Expand All @@ -764,7 +764,7 @@ export class Actor extends Entity implements Eventable, PointerEvents, CanInitia
/**
* Safe to override onPreKill lifecycle event handler. Synonymous with `.on('prekill', (evt) =>{...})`
*
* `onPreKill` is called directly before an actor is killed and removed from its current [[Scene]].
* `onPreKill` is called directly before an actor is killed and removed from its current {@apilink Scene}.
*/
public onPreKill(scene: Scene) {
// Override me
Expand All @@ -773,7 +773,7 @@ export class Actor extends Entity implements Eventable, PointerEvents, CanInitia
/**
* It is not recommended that internal excalibur methods be overridden, do so at your own risk.
*
* Internal _prekill handler for [[onPostKill]] lifecycle event
* Internal _prekill handler for {@apilink onPostKill} lifecycle event
* @internal
*/
public _postkill(scene: Scene) {
Expand All @@ -784,7 +784,7 @@ export class Actor extends Entity implements Eventable, PointerEvents, CanInitia
/**
* Safe to override onPostKill lifecycle event handler. Synonymous with `.on('postkill', (evt) => {...})`
*
* `onPostKill` is called directly after an actor is killed and remove from its current [[Scene]].
* `onPostKill` is called directly after an actor is killed and remove from its current {@apilink Scene}.
*/
public onPostKill(scene: Scene) {
// Override me
Expand Down Expand Up @@ -866,7 +866,7 @@ export class Actor extends Entity implements Eventable, PointerEvents, CanInitia
/**
* Gets this actor's rotation taking into account any parent relationships
* @returns Rotation angle in radians
* @deprecated Use [[globalRotation]] instead
* @deprecated Use {@apilink globalRotation} instead
*/
public getGlobalRotation(): number {
return this.get(TransformComponent).globalRotation;
Expand All @@ -882,7 +882,7 @@ export class Actor extends Entity implements Eventable, PointerEvents, CanInitia
/**
* Gets an actor's world position taking into account parent relationships, scaling, rotation, and translation
* @returns Position in world coordinates
* @deprecated Use [[globalPos]] instead
* @deprecated Use {@apilink globalPos} instead
*/
public getGlobalPos(): Vector {
return this.get(TransformComponent).globalPos;
Expand All @@ -897,7 +897,7 @@ export class Actor extends Entity implements Eventable, PointerEvents, CanInitia

/**
* Gets the global scale of the Actor
* @deprecated Use [[globalScale]] instead
* @deprecated Use {@apilink globalScale} instead
*/
public getGlobalScale(): Vector {
return this.get(TransformComponent).globalScale;
Expand Down Expand Up @@ -1045,7 +1045,7 @@ export class Actor extends Entity implements Eventable, PointerEvents, CanInitia
/**
* It is not recommended that internal excalibur methods be overridden, do so at your own risk.
*
* Internal _preupdate handler for [[onPreUpdate]] lifecycle event
* Internal _preupdate handler for {@apilink onPreUpdate} lifecycle event
* @internal
*/
public _preupdate(engine: Engine, delta: number): void {
Expand All @@ -1056,7 +1056,7 @@ export class Actor extends Entity implements Eventable, PointerEvents, CanInitia
/**
* It is not recommended that internal excalibur methods be overridden, do so at your own risk.
*
* Internal _preupdate handler for [[onPostUpdate]] lifecycle event
* Internal _preupdate handler for {@apilink onPostUpdate} lifecycle event
* @internal
*/
public _postupdate(engine: Engine, delta: number): void {
Expand Down
Loading

0 comments on commit 2f4360d

Please sign in to comment.