@dchighs/dc-assets 0.1.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  import { ChestSpriteQuality } from "@dchighs/dc-core";
2
2
  import { StaticFileDownloader } from "./static-file-downloader";
3
3
  export type ChestSpriteDownloaderOptions = {
4
- imageQuality: ChestSpriteQuality;
4
+ imageQuality?: ChestSpriteQuality;
5
5
  imageName: string;
6
6
  };
7
7
  export declare class ChestSpriteDownloader extends StaticFileDownloader {
@@ -1,13 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ChestSpriteDownloader = void 0;
4
+ const dc_core_1 = require("@dchighs/dc-core");
4
5
  const static_file_downloader_1 = require("./static-file-downloader");
5
6
  class ChestSpriteDownloader extends static_file_downloader_1.StaticFileDownloader {
6
7
  constructor({ imageQuality, imageName }) {
7
8
  super();
8
- this.imageQuality = imageQuality;
9
+ this.imageQuality = imageQuality || dc_core_1.ChestSpriteQuality.Default;
9
10
  this.imageName = imageName;
10
- this.url = `https://dci-static-s1.socialpointgames.com/static/dragoncity/mobile/ui/chests/ui_basic_${imageName}${imageQuality}.png`;
11
+ this.url = `https://dci-static-s1.socialpointgames.com/static/dragoncity/mobile/ui/chests/ui_${imageName}${imageQuality}.png`;
11
12
  }
12
13
  async download(filePath) {
13
14
  return await super.download(this.url, filePath);
@@ -0,0 +1,15 @@
1
+ import { BuildingSpriteQuality, StaticFileUrlPlatformPrefix } from "@dchighs/dc-core";
2
+ import { StaticFileDownloader } from "./static-file-downloader";
3
+ export type DecorationSpriteDownloaderOptions = {
4
+ imageName: string;
5
+ platformPrefix?: StaticFileUrlPlatformPrefix;
6
+ imageQuality?: BuildingSpriteQuality;
7
+ };
8
+ export declare class DecorationSpriteDownloader extends StaticFileDownloader {
9
+ readonly url: string;
10
+ readonly imageName: string;
11
+ readonly imageQuality: BuildingSpriteQuality;
12
+ readonly platformPrefix: StaticFileUrlPlatformPrefix;
13
+ constructor({ imageName, platformPrefix, imageQuality }: DecorationSpriteDownloaderOptions);
14
+ download(filePath: string): Promise<string>;
15
+ }
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DecorationSpriteDownloader = void 0;
4
+ const dc_core_1 = require("@dchighs/dc-core");
5
+ const static_file_downloader_1 = require("./static-file-downloader");
6
+ class DecorationSpriteDownloader extends static_file_downloader_1.StaticFileDownloader {
7
+ constructor({ imageName, platformPrefix, imageQuality }) {
8
+ super();
9
+ this.imageName = imageName;
10
+ this.imageQuality = imageQuality || dc_core_1.BuildingSpriteQuality.Default;
11
+ this.platformPrefix = platformPrefix || dc_core_1.StaticFileUrlPlatformPrefix.Default;
12
+ this.url = `https://${this.platformPrefix}-static-s1.socialpointgames.com/static/dragoncity/mobile/ui/decorations/ui_${imageName}${this.imageQuality}.png`;
13
+ }
14
+ async download(filePath) {
15
+ return await super.download(this.url, filePath);
16
+ }
17
+ }
18
+ exports.DecorationSpriteDownloader = DecorationSpriteDownloader;
@@ -0,0 +1,13 @@
1
+ import { StaticFileUrlPlatformPrefix } from "@dchighs/dc-core";
2
+ import { StaticFileDownloader } from "./static-file-downloader";
3
+ export type DecorationThumbnailDownloaderOptions = {
4
+ imageName: string;
5
+ platformPrefix?: StaticFileUrlPlatformPrefix;
6
+ };
7
+ export declare class DecorationThumbnailDownloader extends StaticFileDownloader {
8
+ readonly url: string;
9
+ readonly imageName: string;
10
+ readonly platformPrefix: StaticFileUrlPlatformPrefix;
11
+ constructor({ imageName, platformPrefix }: DecorationThumbnailDownloaderOptions);
12
+ download(filePath: string): Promise<string>;
13
+ }
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DecorationThumbnailDownloader = void 0;
4
+ const dc_core_1 = require("@dchighs/dc-core");
5
+ const static_file_downloader_1 = require("./static-file-downloader");
6
+ class DecorationThumbnailDownloader extends static_file_downloader_1.StaticFileDownloader {
7
+ constructor({ imageName, platformPrefix }) {
8
+ super();
9
+ this.imageName = imageName;
10
+ this.platformPrefix = platformPrefix || dc_core_1.StaticFileUrlPlatformPrefix.Default;
11
+ this.url = `https://${this.platformPrefix}-static-s1.socialpointgames.com/static/dragoncity/assets/thumbs/${imageName}.jpg`;
12
+ }
13
+ async download(filePath) {
14
+ return await super.download(this.url, filePath);
15
+ }
16
+ }
17
+ exports.DecorationThumbnailDownloader = DecorationThumbnailDownloader;
package/dist/index.d.ts CHANGED
@@ -7,6 +7,8 @@ import { MusicDownloader, MusicDownloaderOptions } from "./music-downloader";
7
7
  import { ChestSpriteDownloader, ChestSpriteDownloaderOptions } from "./chest-sprite-downloader";
8
8
  import { BuildingSpriteDownloader, BuildingSpriteDownloaderOptions } from "./building-sprite-downloader";
9
9
  import { BuildingThumbnailDownloader, BuildingThumbnailDownloaderOptions } from "./building-thumbnail-downloader";
10
+ import { DecorationSpriteDownloader, DecorationSpriteDownloaderOptions } from "./decoration-sprite-downloader";
11
+ import { DecorationThumbnailDownloader, DecorationThumbnailDownloaderOptions } from "./decoration-thumbnail-downloader";
10
12
  declare const dcAssets: {
11
13
  dragons: {
12
14
  animations: {
@@ -29,6 +31,10 @@ declare const dcAssets: {
29
31
  sprite: (options: BuildingSpriteDownloaderOptions) => BuildingSpriteDownloader;
30
32
  thumbnail: (options: BuildingThumbnailDownloaderOptions) => BuildingThumbnailDownloader;
31
33
  };
34
+ decorations: {
35
+ sprite: (options: DecorationSpriteDownloaderOptions) => DecorationSpriteDownloader;
36
+ thumbnail: (options: DecorationThumbnailDownloaderOptions) => DecorationThumbnailDownloader;
37
+ };
32
38
  habitats: {
33
39
  sprite: null;
34
40
  };
@@ -42,4 +48,6 @@ export * from "./chest-sprite-downloader";
42
48
  export * from "./music-downloader";
43
49
  export * from "./building-sprite-downloader";
44
50
  export * from "./building-thumbnail-downloader";
51
+ export * from "./decoration-sprite-downloader";
52
+ export * from "./decoration-thumbnail-downloader";
45
53
  export default dcAssets;
package/dist/index.js CHANGED
@@ -23,6 +23,8 @@ const music_downloader_1 = require("./music-downloader");
23
23
  const chest_sprite_downloader_1 = require("./chest-sprite-downloader");
24
24
  const building_sprite_downloader_1 = require("./building-sprite-downloader");
25
25
  const building_thumbnail_downloader_1 = require("./building-thumbnail-downloader");
26
+ const decoration_sprite_downloader_1 = require("./decoration-sprite-downloader");
27
+ const decoration_thumbnail_downloader_1 = require("./decoration-thumbnail-downloader");
26
28
  const dcAssets = {
27
29
  dragons: {
28
30
  animations: {
@@ -45,6 +47,10 @@ const dcAssets = {
45
47
  sprite: (options) => new building_sprite_downloader_1.BuildingSpriteDownloader(options),
46
48
  thumbnail: (options) => new building_thumbnail_downloader_1.BuildingThumbnailDownloader(options)
47
49
  },
50
+ decorations: {
51
+ sprite: (options) => new decoration_sprite_downloader_1.DecorationSpriteDownloader(options),
52
+ thumbnail: (options) => new decoration_thumbnail_downloader_1.DecorationThumbnailDownloader(options)
53
+ },
48
54
  habitats: {
49
55
  sprite: null
50
56
  }
@@ -58,4 +64,6 @@ __exportStar(require("./chest-sprite-downloader"), exports);
58
64
  __exportStar(require("./music-downloader"), exports);
59
65
  __exportStar(require("./building-sprite-downloader"), exports);
60
66
  __exportStar(require("./building-thumbnail-downloader"), exports);
67
+ __exportStar(require("./decoration-sprite-downloader"), exports);
68
+ __exportStar(require("./decoration-thumbnail-downloader"), exports);
61
69
  exports.default = dcAssets;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dchighs/dc-assets",
3
- "version": "0.1.0",
3
+ "version": "0.2.1",
4
4
  "description": "Library focused on downloading static files from the Dragon City server.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",