Continue adaptation work
This commit is contained in:
@ -1,37 +1,39 @@
|
||||
export const drunk = (app: any) => (n?: number): number => {
|
||||
/**
|
||||
* This function sets or returns the current drunk mechanism's value.
|
||||
* @param n - [optional] The value to set the drunk mechanism to
|
||||
* @returns The current value of the drunk mechanism
|
||||
*/
|
||||
if (n !== undefined) {
|
||||
app._drunk.position = n;
|
||||
return app._drunk.getPosition();
|
||||
}
|
||||
app._drunk.step();
|
||||
return app._drunk.getPosition();
|
||||
import { type UserAPI } from './API';
|
||||
|
||||
export const drunk = (api: UserAPI) => (n?: number): number => {
|
||||
/**
|
||||
* This function sets or returns the current drunk mechanism's value.
|
||||
* @param n - [optional] The value to set the drunk mechanism to
|
||||
* @returns The current value of the drunk mechanism
|
||||
*/
|
||||
if (n !== undefined) {
|
||||
api._drunk.position = n;
|
||||
return api._drunk.getPosition();
|
||||
}
|
||||
api._drunk.step();
|
||||
return api._drunk.getPosition();
|
||||
};
|
||||
|
||||
export const drunk_max = (app: any) => (max: number): void => {
|
||||
/**
|
||||
* Sets the maximum value of the drunk mechanism.
|
||||
* @param max - The maximum value of the drunk mechanism
|
||||
*/
|
||||
app._drunk.max = max;
|
||||
export const drunk_max = (api: UserAPI) => (max: number): void => {
|
||||
/**
|
||||
* Sets the maximum value of the drunk mechanism.
|
||||
* @param max - The maximum value of the drunk mechanism
|
||||
*/
|
||||
api._drunk.max = max;
|
||||
};
|
||||
|
||||
export const drunk_min = (app: any) => (min: number): void => {
|
||||
/**
|
||||
* Sets the minimum value of the drunk mechanism.
|
||||
* @param min - The minimum value of the drunk mechanism
|
||||
*/
|
||||
app._drunk.min = min;
|
||||
export const drunk_min = (api: UserAPI) => (min: number): void => {
|
||||
/**
|
||||
* Sets the minimum value of the drunk mechanism.
|
||||
* @param min - The minimum value of the drunk mechanism
|
||||
*/
|
||||
api._drunk.min = min;
|
||||
};
|
||||
|
||||
export const drunk_wrap = (app: any) => (wrap: boolean): void => {
|
||||
/**
|
||||
* Sets whether the drunk mechanism should wrap around
|
||||
* @param wrap - Whether the drunk mechanism should wrap around
|
||||
*/
|
||||
app._drunk.toggleWrap(wrap);
|
||||
};
|
||||
export const drunk_wrap = (api: UserAPI) => (wrap: boolean): void => {
|
||||
/**
|
||||
* Sets whether the drunk mechanism should wrap around
|
||||
* @param wrap - Whether the drunk mechanism should wrap around
|
||||
*/
|
||||
api._drunk.toggleWrap(wrap);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user