-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change GameCurrency and GameAttribute to extend their static counterp…
…arts GameCurrency now extends CurrencyStatic and GameAttribute now extends AttributeStatic. Their methods are now included within the class, so you will no longer need to destruct the `static` property
- Loading branch information
1 parent
2b202b0
commit 8665121
Showing
10 changed files
with
222 additions
and
212 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,32 @@ | ||
/** | ||
* @file Declares the game currency class. | ||
*/ | ||
import type { Decimal } from "../E/e"; | ||
import type { Attribute, AttributeStatic } from "../classes/Attribute"; | ||
import type { Attribute } from "../classes/Attribute"; | ||
import { AttributeStatic } from "../classes/Attribute"; | ||
import type { Game } from "./Game"; | ||
import type { Pointer } from "../common/types"; | ||
/** | ||
* Represents a game attribute. {@link Attribute} is the data class and {@link AttributeStatic} is the static class where all the useful functions are. | ||
* To use, destruct the `data` and `static` properties from the class. | ||
* WIP, not fully implemented. | ||
* @template B - Indicates whether the boost is enabled. Defaults to true. | ||
*/ | ||
declare class GameAttribute<B extends boolean = true> { | ||
data: Attribute; | ||
static: AttributeStatic<B>; | ||
game?: Game; | ||
declare class GameAttribute<B extends boolean = true> extends AttributeStatic<B> { | ||
/** | ||
* Creates a new instance of the attribute class. | ||
* @param attributePointer - A function that returns the current attribute value. | ||
* @param staticPointer - A function that returns the static data for the attribute. | ||
* @param gamePointer A pointer to the game instance. | ||
* @returns The data for the attribute. | ||
* @deprecated Use {@link pointer} instead. This property is only here for backwards compatibility. | ||
*/ | ||
constructor(attributePointer: Pointer<Attribute>, staticPointer: Pointer<AttributeStatic<B>>, gamePointer?: Game); | ||
get data(): Attribute; | ||
/** | ||
* Gets the value of the attribute. | ||
* NOTE: This getter is sometimes inaccurate. | ||
* @returns The value of the attribute. | ||
* @returns The static data for the attribute. | ||
* @deprecated Use this class as a static. This property is only here for backwards compatibility. | ||
*/ | ||
get value(): Decimal; | ||
get static(): this; | ||
/** The game pointer/reference */ | ||
game?: Game; | ||
/** | ||
* Sets the value of the attribute. | ||
* NOTE: This setter should not be used when boost is enabled. | ||
* @param value - The value to set the attribute to. | ||
* Creates a new instance of the attribute class. | ||
* @param attributeStaticParams - The parameters for the attribute static class. | ||
* @param gamePointer A pointer to the game instance. | ||
*/ | ||
set value(value: Decimal); | ||
constructor(attributeStaticParams: ConstructorParameters<typeof AttributeStatic<B>>, gamePointer?: Game); | ||
} | ||
export { GameAttribute }; |
Oops, something went wrong.