From 561318b7dbb7f78e8ff2a60011ae7065c9c90c80 Mon Sep 17 00:00:00 2001 From: Dimava Date: Tue, 15 Feb 2022 10:31:47 +0300 Subject: [PATCH] mark all abstract functions abstract (#1383) --- src/js/core/game_state.js | 1 + src/js/core/sprites.js | 1 + src/js/game/base_item.js | 5 ++++- src/js/game/component.js | 1 + src/js/game/entity.js | 1 + src/js/game/game_mode.js | 1 + src/js/game/hud/base_hud_part.js | 1 + src/js/game/meta_building.js | 1 + src/js/platform/achievement_provider.js | 4 ++++ src/js/platform/ad_provider.js | 2 ++ src/js/platform/analytics.js | 1 + src/js/platform/game_analytics.js | 2 ++ src/js/platform/storage.js | 3 +++ src/js/platform/wrapper.js | 4 ++++ src/js/profile/setting_types.js | 3 +++ src/js/savegame/serialization_data_types.js | 4 ++++ 16 files changed, 34 insertions(+), 1 deletion(-) diff --git a/src/js/core/game_state.js b/src/js/core/game_state.js index b08bef77..fb08e28d 100644 --- a/src/js/core/game_state.js +++ b/src/js/core/game_state.js @@ -211,6 +211,7 @@ export class GameState { /** * Should return the html code of the state. * @returns {string} + * @abstract */ getInnerHTML() { abstract; diff --git a/src/js/core/sprites.js b/src/js/core/sprites.js index 51032e4e..d568f994 100644 --- a/src/js/core/sprites.js +++ b/src/js/core/sprites.js @@ -11,6 +11,7 @@ export class BaseSprite { /** * Returns the raw handle * @returns {HTMLImageElement|HTMLCanvasElement} + * @abstract */ getRawTexture() { abstract; diff --git a/src/js/game/base_item.js b/src/js/game/base_item.js index f6ed1672..a6b38a08 100644 --- a/src/js/game/base_item.js +++ b/src/js/game/base_item.js @@ -29,6 +29,7 @@ export class BaseItem extends BasicSerializableObject { /** * Returns a string id of the item * @returns {string} + * @abstract */ getAsCopyableKey() { abstract; @@ -49,9 +50,9 @@ export class BaseItem extends BasicSerializableObject { /** * Override for custom comparison - * @abstract * @param {BaseItem} other * @returns {boolean} + * @abstract */ equalsImpl(other) { abstract; @@ -62,6 +63,7 @@ export class BaseItem extends BasicSerializableObject { * Draws the item to a canvas * @param {CanvasRenderingContext2D} context * @param {number} size + * @abstract */ drawFullSizeOnCanvas(context, size) { abstract; @@ -86,6 +88,7 @@ export class BaseItem extends BasicSerializableObject { * @param {number} y * @param {DrawParameters} parameters * @param {number=} diameter + * @abstract */ drawItemCenteredImpl(x, y, parameters, diameter = globalConfig.defaultItemDiameter) { abstract; diff --git a/src/js/game/component.js b/src/js/game/component.js index cff14d62..9e1b63f4 100644 --- a/src/js/game/component.js +++ b/src/js/game/component.js @@ -4,6 +4,7 @@ export class Component extends BasicSerializableObject { /** * Returns the components unique id * @returns {string} + * @abstract */ static getId() { abstract; diff --git a/src/js/game/entity.js b/src/js/game/entity.js index 3010f067..9acaf26b 100644 --- a/src/js/game/entity.js +++ b/src/js/game/entity.js @@ -224,6 +224,7 @@ export class Entity extends BasicSerializableObject { /** * override, should draw the entity * @param {DrawParameters} parameters + * @abstract */ drawImpl(parameters) { abstract; diff --git a/src/js/game/game_mode.js b/src/js/game/game_mode.js index 5414306c..2c4527e3 100644 --- a/src/js/game/game_mode.js +++ b/src/js/game/game_mode.js @@ -144,6 +144,7 @@ export class GameMode extends BasicSerializableObject { /** * @param {number} w * @param {number} h + * @abstract */ adjustZone(w = 0, h = 0) { abstract; diff --git a/src/js/game/hud/base_hud_part.js b/src/js/game/hud/base_hud_part.js index 84b6d619..91b3fd3a 100644 --- a/src/js/game/hud/base_hud_part.js +++ b/src/js/game/hud/base_hud_part.js @@ -25,6 +25,7 @@ export class BaseHUDPart { /** * Should initialize the element, called *after* the elements have been created + * @abstract */ initialize() { abstract; diff --git a/src/js/game/meta_building.js b/src/js/game/meta_building.js index 0e92d3d9..4482a281 100644 --- a/src/js/game/meta_building.js +++ b/src/js/game/meta_building.js @@ -278,6 +278,7 @@ export class MetaBuilding { * Should setup the entity components * @param {Entity} entity * @param {GameRoot} root + * @abstract */ setupEntityComponents(entity, root) { abstract; diff --git a/src/js/platform/achievement_provider.js b/src/js/platform/achievement_provider.js index 583dbfb2..3b60ad95 100644 --- a/src/js/platform/achievement_provider.js +++ b/src/js/platform/achievement_provider.js @@ -92,6 +92,7 @@ export class AchievementProviderInterface { /** * Initializes the achievement provider. * @returns {Promise} + * @abstract */ initialize() { abstract; @@ -102,6 +103,7 @@ export class AchievementProviderInterface { * Opportunity to do additional initialization work with the GameRoot. * @param {GameRoot} root * @returns {Promise} + * @abstract */ onLoad(root) { abstract; @@ -118,6 +120,7 @@ export class AchievementProviderInterface { * Call to activate an achievement with the provider * @param {string} key - Maps to an Achievement * @returns {Promise} + * @abstract */ activate(key) { abstract; @@ -127,6 +130,7 @@ export class AchievementProviderInterface { /** * Checks if achievements are supported in the current build * @returns {boolean} + * @abstract */ hasAchievements() { abstract; diff --git a/src/js/platform/ad_provider.js b/src/js/platform/ad_provider.js index a614a793..4aa8949c 100644 --- a/src/js/platform/ad_provider.js +++ b/src/js/platform/ad_provider.js @@ -19,6 +19,7 @@ export class AdProviderInterface { /** * Returns if this provider serves ads at all * @returns {boolean} + * @abstract */ getHasAds() { abstract; @@ -29,6 +30,7 @@ export class AdProviderInterface { * Returns if it would be possible to show a video ad *now*. This can be false if for * example the last video ad is * @returns {boolean} + * @abstract */ getCanShowVideoAd() { abstract; diff --git a/src/js/platform/analytics.js b/src/js/platform/analytics.js index 7bd7ae50..cf839aca 100644 --- a/src/js/platform/analytics.js +++ b/src/js/platform/analytics.js @@ -11,6 +11,7 @@ export class AnalyticsInterface { /** * Initializes the analytics * @returns {Promise} + * @abstract */ initialize() { abstract; diff --git a/src/js/platform/game_analytics.js b/src/js/platform/game_analytics.js index 00286fc2..19fdf752 100644 --- a/src/js/platform/game_analytics.js +++ b/src/js/platform/game_analytics.js @@ -11,6 +11,7 @@ export class GameAnalyticsInterface { /** * Initializes the analytics * @returns {Promise} + * @abstract */ initialize() { abstract; @@ -43,6 +44,7 @@ export class GameAnalyticsInterface { /** * Activates a DLC * @param {string} dlc + * @abstract */ activateDlc(dlc) { abstract; diff --git a/src/js/platform/storage.js b/src/js/platform/storage.js index 165ee828..c5c3701c 100644 --- a/src/js/platform/storage.js +++ b/src/js/platform/storage.js @@ -13,6 +13,7 @@ export class StorageInterface { /** * Initializes the storage * @returns {Promise} + * @abstract */ initialize() { abstract; @@ -24,6 +25,7 @@ export class StorageInterface { * @param {string} filename * @param {string} contents * @returns {Promise} + * @abstract */ writeFileAsync(filename, contents) { abstract; @@ -34,6 +36,7 @@ export class StorageInterface { * Reads a string asynchronously. Returns Promise if file was not found. * @param {string} filename * @returns {Promise} + * @abstract */ readFileAsync(filename) { abstract; diff --git a/src/js/platform/wrapper.js b/src/js/platform/wrapper.js index f80c2fd6..e0a896fb 100644 --- a/src/js/platform/wrapper.js +++ b/src/js/platform/wrapper.js @@ -81,6 +81,7 @@ export class PlatformWrapperInterface { * Attempt to open an external url * @param {string} url * @param {boolean=} force Whether to always open the url even if not allowed + * @abstract */ openExternalLink(url, force = false) { abstract; @@ -88,6 +89,7 @@ export class PlatformWrapperInterface { /** * Attempt to restart the app + * @abstract */ performRestart() { abstract; @@ -103,6 +105,7 @@ export class PlatformWrapperInterface { /** * Should set the apps fullscreen state to the desired state * @param {boolean} flag + * @abstract */ setFullscreen(flag) { abstract; @@ -117,6 +120,7 @@ export class PlatformWrapperInterface { /** * Attempts to quit the app + * @abstract */ exitApp() { abstract; diff --git a/src/js/profile/setting_types.js b/src/js/profile/setting_types.js index 4df02892..943e8e53 100644 --- a/src/js/profile/setting_types.js +++ b/src/js/profile/setting_types.js @@ -64,6 +64,7 @@ export class BaseSetting { /** * Returns the HTML for this setting * @param {Application} app + * @abstract */ getHtml(app) { abstract; @@ -84,6 +85,7 @@ export class BaseSetting { /** * Attempts to modify the setting + * @abstract */ modify() { abstract; @@ -107,6 +109,7 @@ export class BaseSetting { * Validates the set value * @param {any} value * @returns {boolean} + * @abstract */ validate(value) { abstract; diff --git a/src/js/savegame/serialization_data_types.js b/src/js/savegame/serialization_data_types.js index df352e78..c27e2295 100644 --- a/src/js/savegame/serialization_data_types.js +++ b/src/js/savegame/serialization_data_types.js @@ -48,6 +48,7 @@ export class BaseDataType { /** * Serializes a given raw value * @param {any} value + * @abstract */ serialize(value) { abstract; @@ -68,6 +69,7 @@ export class BaseDataType { * @param {object} targetObject * @param {string|number} targetKey * @returns {string|void} String error code or null on success + * @abstract */ deserialize(value, targetObject, targetKey, root) { abstract; @@ -92,6 +94,7 @@ export class BaseDataType { /** * INTERNAL Should return the json schema representation + * @abstract */ getAsJsonSchemaUncached() { abstract; @@ -131,6 +134,7 @@ export class BaseDataType { /** * Should return a cacheable key + * @abstract */ getCacheKey() { abstract;