@kk-garden/shared 1.0.0
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.
- package/dist/assets/asssets-map.d.ts +10 -0
- package/dist/assets/asssets-map.d.ts.map +1 -0
- package/dist/assets/asssets-map.js +13 -0
- package/dist/assets/asssets-map.js.map +1 -0
- package/dist/assets/index.d.ts +2 -0
- package/dist/assets/index.d.ts.map +1 -0
- package/dist/assets/index.js +2 -0
- package/dist/assets/index.js.map +1 -0
- package/dist/assets/spritesheets/animation_spritesheet.png +0 -0
- package/dist/assets/spritesheets/decorations_spritesheet.png +0 -0
- package/dist/assets/spritesheets/stones_spritesheet.png +0 -0
- package/dist/assets/spritesheets/tiles_spritesheet.png +0 -0
- package/dist/constants/decoration-constants.d.ts +16 -0
- package/dist/constants/decoration-constants.d.ts.map +1 -0
- package/dist/constants/decoration-constants.js +18 -0
- package/dist/constants/decoration-constants.js.map +1 -0
- package/dist/constants/grid-constants.d.ts +10 -0
- package/dist/constants/grid-constants.d.ts.map +1 -0
- package/dist/constants/grid-constants.js +20 -0
- package/dist/constants/grid-constants.js.map +1 -0
- package/dist/constants/index.d.ts +5 -0
- package/dist/constants/index.d.ts.map +1 -0
- package/dist/constants/index.js +5 -0
- package/dist/constants/index.js.map +1 -0
- package/dist/constants/object-constants.d.ts +20 -0
- package/dist/constants/object-constants.d.ts.map +1 -0
- package/dist/constants/object-constants.js +24 -0
- package/dist/constants/object-constants.js.map +1 -0
- package/dist/constants/path-constants.d.ts +21 -0
- package/dist/constants/path-constants.d.ts.map +1 -0
- package/dist/constants/path-constants.js +24 -0
- package/dist/constants/path-constants.js.map +1 -0
- package/dist/spritesheet-set/animated-sprite/animated-sprite-set.d.ts +8 -0
- package/dist/spritesheet-set/animated-sprite/animated-sprite-set.d.ts.map +1 -0
- package/dist/spritesheet-set/animated-sprite/animated-sprite-set.js +21 -0
- package/dist/spritesheet-set/animated-sprite/animated-sprite-set.js.map +1 -0
- package/dist/spritesheet-set/animated-sprite/animated-sprite.d.ts +9 -0
- package/dist/spritesheet-set/animated-sprite/animated-sprite.d.ts.map +1 -0
- package/dist/spritesheet-set/animated-sprite/animated-sprite.js +13 -0
- package/dist/spritesheet-set/animated-sprite/animated-sprite.js.map +1 -0
- package/dist/spritesheet-set/animation-sets/bushes-set/bushes-animation-set.d.ts +3 -0
- package/dist/spritesheet-set/animation-sets/bushes-set/bushes-animation-set.d.ts.map +1 -0
- package/dist/spritesheet-set/animation-sets/bushes-set/bushes-animation-set.js +12 -0
- package/dist/spritesheet-set/animation-sets/bushes-set/bushes-animation-set.js.map +1 -0
- package/dist/spritesheet-set/animation-sets/bushes-set/simple-bush/simple-bush-sprite.d.ts +3 -0
- package/dist/spritesheet-set/animation-sets/bushes-set/simple-bush/simple-bush-sprite.d.ts.map +1 -0
- package/dist/spritesheet-set/animation-sets/bushes-set/simple-bush/simple-bush-sprite.js +25 -0
- package/dist/spritesheet-set/animation-sets/bushes-set/simple-bush/simple-bush-sprite.js.map +1 -0
- package/dist/spritesheet-set/animation-sets/trees-set/regular-tree/regular-tree-sprite.d.ts +3 -0
- package/dist/spritesheet-set/animation-sets/trees-set/regular-tree/regular-tree-sprite.d.ts.map +1 -0
- package/dist/spritesheet-set/animation-sets/trees-set/regular-tree/regular-tree-sprite.js +25 -0
- package/dist/spritesheet-set/animation-sets/trees-set/regular-tree/regular-tree-sprite.js.map +1 -0
- package/dist/spritesheet-set/animation-sets/trees-set/trees-animation-set.d.ts +3 -0
- package/dist/spritesheet-set/animation-sets/trees-set/trees-animation-set.d.ts.map +1 -0
- package/dist/spritesheet-set/animation-sets/trees-set/trees-animation-set.js +12 -0
- package/dist/spritesheet-set/animation-sets/trees-set/trees-animation-set.js.map +1 -0
- package/dist/spritesheet-set/density-pick.d.ts +7 -0
- package/dist/spritesheet-set/density-pick.d.ts.map +1 -0
- package/dist/spritesheet-set/density-pick.js +21 -0
- package/dist/spritesheet-set/density-pick.js.map +1 -0
- package/dist/spritesheet-set/index.d.ts +9 -0
- package/dist/spritesheet-set/index.d.ts.map +1 -0
- package/dist/spritesheet-set/index.js +9 -0
- package/dist/spritesheet-set/index.js.map +1 -0
- package/dist/spritesheet-set/sets/decorations-set.d.ts +140 -0
- package/dist/spritesheet-set/sets/decorations-set.d.ts.map +1 -0
- package/dist/spritesheet-set/sets/decorations-set.js +143 -0
- package/dist/spritesheet-set/sets/decorations-set.js.map +1 -0
- package/dist/spritesheet-set/sets/stones-set.d.ts +21 -0
- package/dist/spritesheet-set/sets/stones-set.d.ts.map +1 -0
- package/dist/spritesheet-set/sets/stones-set.js +24 -0
- package/dist/spritesheet-set/sets/stones-set.js.map +1 -0
- package/dist/spritesheet-set/sets/tiles-set.d.ts +296 -0
- package/dist/spritesheet-set/sets/tiles-set.d.ts.map +1 -0
- package/dist/spritesheet-set/sets/tiles-set.js +401 -0
- package/dist/spritesheet-set/sets/tiles-set.js.map +1 -0
- package/dist/spritesheet-set/spritesheet-set.d.ts +13 -0
- package/dist/spritesheet-set/spritesheet-set.d.ts.map +1 -0
- package/dist/spritesheet-set/spritesheet-set.js +38 -0
- package/dist/spritesheet-set/spritesheet-set.js.map +1 -0
- package/dist/src/globals.d.ts +4 -0
- package/dist/types/animated-sprite.types.d.ts +15 -0
- package/dist/types/animated-sprite.types.d.ts.map +1 -0
- package/dist/types/animated-sprite.types.js +2 -0
- package/dist/types/animated-sprite.types.js.map +1 -0
- package/dist/types/common.types.d.ts +23 -0
- package/dist/types/common.types.d.ts.map +1 -0
- package/dist/types/common.types.js +2 -0
- package/dist/types/common.types.js.map +1 -0
- package/dist/types/grid-drawer.types.d.ts +27 -0
- package/dist/types/grid-drawer.types.d.ts.map +1 -0
- package/dist/types/grid-drawer.types.js +2 -0
- package/dist/types/grid-drawer.types.js.map +1 -0
- package/dist/types/index.d.ts +8 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +3 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/path.types.d.ts +13 -0
- package/dist/types/path.types.d.ts.map +1 -0
- package/dist/types/path.types.js +2 -0
- package/dist/types/path.types.js.map +1 -0
- package/dist/types/spritesheet-element.types.d.ts +13 -0
- package/dist/types/spritesheet-element.types.d.ts.map +1 -0
- package/dist/types/spritesheet-element.types.js +2 -0
- package/dist/types/spritesheet-element.types.js.map +1 -0
- package/package.json +39 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const AssetsMap: {
|
|
2
|
+
readonly 'animation-spritesheet': string;
|
|
3
|
+
readonly 'decorations-spritesheet': string;
|
|
4
|
+
readonly 'stones-spritesheet': string;
|
|
5
|
+
readonly 'tiles-spritesheet': string;
|
|
6
|
+
};
|
|
7
|
+
export type SpritesheetAssetKey = Extract<keyof typeof AssetsMap, `${string}-spritesheet`>;
|
|
8
|
+
export declare const getSpritesheetAsset: (key: SpritesheetAssetKey) => string;
|
|
9
|
+
export declare const isSpritesheetAssetKey: (key: string) => key is SpritesheetAssetKey;
|
|
10
|
+
//# sourceMappingURL=asssets-map.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"asssets-map.d.ts","sourceRoot":"","sources":["../../src/assets/asssets-map.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,SAAS;;;;;CAKqB,CAAC;AAE5C,MAAM,MAAM,mBAAmB,GAAG,OAAO,CACvC,MAAM,OAAO,SAAS,EACtB,GAAG,MAAM,cAAc,CACxB,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,KAAK,mBAAmB,KAAG,MAC/C,CAAC;AAEjB,eAAO,MAAM,qBAAqB,GAChC,KAAK,MAAM,KACV,GAAG,IAAI,mBAC4D,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import AnimationSpritesheet from './spritesheets/animation_spritesheet.png';
|
|
2
|
+
import DecorationsSpritesheet from './spritesheets/decorations_spritesheet.png';
|
|
3
|
+
import StonesSpritesheet from './spritesheets/stones_spritesheet.png';
|
|
4
|
+
import TilesSpritesheet from './spritesheets/tiles_spritesheet.png';
|
|
5
|
+
export const AssetsMap = {
|
|
6
|
+
'animation-spritesheet': AnimationSpritesheet,
|
|
7
|
+
'decorations-spritesheet': DecorationsSpritesheet,
|
|
8
|
+
'stones-spritesheet': StonesSpritesheet,
|
|
9
|
+
'tiles-spritesheet': TilesSpritesheet,
|
|
10
|
+
};
|
|
11
|
+
export const getSpritesheetAsset = (key) => AssetsMap[key];
|
|
12
|
+
export const isSpritesheetAssetKey = (key) => key.endsWith('-spritesheet') && Object.keys(AssetsMap).includes(key);
|
|
13
|
+
//# sourceMappingURL=asssets-map.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"asssets-map.js","sourceRoot":"","sources":["../../src/assets/asssets-map.ts"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,MAAM,0CAA0C,CAAC;AAC5E,OAAO,sBAAsB,MAAM,4CAA4C,CAAC;AAChF,OAAO,iBAAiB,MAAM,uCAAuC,CAAC;AACtE,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AAEpE,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,uBAAuB,EAAE,oBAAoB;IAC7C,yBAAyB,EAAE,sBAAsB;IACjD,oBAAoB,EAAE,iBAAiB;IACvC,mBAAmB,EAAE,gBAAgB;CACI,CAAC;AAO5C,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,GAAwB,EAAU,EAAE,CACtE,SAAS,CAAC,GAAG,CAAC,CAAC;AAEjB,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACnC,GAAW,EACiB,EAAE,CAC9B,GAAG,CAAC,QAAQ,CAAC,cAAc,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/assets/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,KAAK,mBAAmB,EACxB,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/assets/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAET,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,eAAe,CAAC"}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type DecorationWeights = {
|
|
2
|
+
density: number;
|
|
3
|
+
frequency: number;
|
|
4
|
+
};
|
|
5
|
+
export type DecorationMetrics = {
|
|
6
|
+
padding: number;
|
|
7
|
+
};
|
|
8
|
+
export declare class DecorationConstants {
|
|
9
|
+
private readonly weights;
|
|
10
|
+
private readonly metrics;
|
|
11
|
+
constructor(weights: DecorationWeights, metrics: DecorationMetrics);
|
|
12
|
+
get decorationsDensity(): number;
|
|
13
|
+
get decorationsFrequency(): number;
|
|
14
|
+
get padding(): number;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=decoration-constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decoration-constants.d.ts","sourceRoot":"","sources":["../../src/constants/decoration-constants.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAoB;IAC5C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAoB;gBAEhC,OAAO,EAAE,iBAAiB,EAAE,OAAO,EAAE,iBAAiB;IAKlE,IAAI,kBAAkB,IAAI,MAAM,CAE/B;IAED,IAAI,oBAAoB,IAAI,MAAM,CAEjC;IAED,IAAI,OAAO,IAAI,MAAM,CAEpB;CACF"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export class DecorationConstants {
|
|
2
|
+
weights;
|
|
3
|
+
metrics;
|
|
4
|
+
constructor(weights, metrics) {
|
|
5
|
+
this.weights = weights;
|
|
6
|
+
this.metrics = metrics;
|
|
7
|
+
}
|
|
8
|
+
get decorationsDensity() {
|
|
9
|
+
return this.weights.density;
|
|
10
|
+
}
|
|
11
|
+
get decorationsFrequency() {
|
|
12
|
+
return this.weights.frequency;
|
|
13
|
+
}
|
|
14
|
+
get padding() {
|
|
15
|
+
return this.metrics.padding;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=decoration-constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decoration-constants.js","sourceRoot":"","sources":["../../src/constants/decoration-constants.ts"],"names":[],"mappings":"AASA,MAAM,OAAO,mBAAmB;IACb,OAAO,CAAoB;IAC3B,OAAO,CAAoB;IAE5C,YAAY,OAA0B,EAAE,OAA0B;QAChE,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED,IAAI,kBAAkB;QACpB,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;IAC9B,CAAC;IAED,IAAI,oBAAoB;QACtB,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC;IAChC,CAAC;IAED,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;IAC9B,CAAC;CACF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare class GridConstants {
|
|
2
|
+
private readonly size;
|
|
3
|
+
readonly columns: number;
|
|
4
|
+
readonly rows: number;
|
|
5
|
+
constructor(cellSize: number, gridColumns: number, gridRows: number);
|
|
6
|
+
get cellSize(): number;
|
|
7
|
+
get canvasWidth(): number;
|
|
8
|
+
get canvasHeight(): number;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=grid-constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grid-constants.d.ts","sourceRoot":"","sources":["../../src/constants/grid-constants.ts"],"names":[],"mappings":"AAAA,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAS;IAC9B,SAAgB,OAAO,EAAE,MAAM,CAAC;IAChC,SAAgB,IAAI,EAAE,MAAM,CAAC;gBAEjB,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;IAMnE,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED,IAAI,WAAW,IAAI,MAAM,CAExB;IAED,IAAI,YAAY,IAAI,MAAM,CAEzB;CACF"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export class GridConstants {
|
|
2
|
+
size;
|
|
3
|
+
columns;
|
|
4
|
+
rows;
|
|
5
|
+
constructor(cellSize, gridColumns, gridRows) {
|
|
6
|
+
this.size = cellSize;
|
|
7
|
+
this.columns = gridColumns;
|
|
8
|
+
this.rows = gridRows;
|
|
9
|
+
}
|
|
10
|
+
get cellSize() {
|
|
11
|
+
return this.size;
|
|
12
|
+
}
|
|
13
|
+
get canvasWidth() {
|
|
14
|
+
return this.size * this.columns;
|
|
15
|
+
}
|
|
16
|
+
get canvasHeight() {
|
|
17
|
+
return this.size * this.rows;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=grid-constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grid-constants.js","sourceRoot":"","sources":["../../src/constants/grid-constants.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,aAAa;IACP,IAAI,CAAS;IACd,OAAO,CAAS;IAChB,IAAI,CAAS;IAE7B,YAAY,QAAgB,EAAE,WAAmB,EAAE,QAAgB;QACjE,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,WAAW,CAAC;QAC3B,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC;IACvB,CAAC;IAED,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED,IAAI,WAAW;QACb,OAAO,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC;IAClC,CAAC;IAED,IAAI,YAAY;QACd,OAAO,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;IAC/B,CAAC;CACF"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { DecorationConstants, type DecorationWeights, type DecorationMetrics, } from './decoration-constants';
|
|
2
|
+
export { GridConstants } from './grid-constants';
|
|
3
|
+
export { ObjectConstants, type ObjectWeights, type ObjectMetrics, } from './object-constants';
|
|
4
|
+
export { PathConstants, type PathWeights, type PathMetrics, } from './path-constants';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,GACvB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EACL,eAAe,EACf,KAAK,aAAa,EAClB,KAAK,aAAa,GACnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,aAAa,EACb,KAAK,WAAW,EAChB,KAAK,WAAW,GACjB,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,GAGpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EACL,eAAe,GAGhB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,aAAa,GAGd,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type ObjectWeights = {
|
|
2
|
+
density: number;
|
|
3
|
+
grouping: number;
|
|
4
|
+
diversity: number;
|
|
5
|
+
};
|
|
6
|
+
export type ObjectMetrics = {
|
|
7
|
+
minAmount: number;
|
|
8
|
+
maxAmount: number;
|
|
9
|
+
};
|
|
10
|
+
export declare class ObjectConstants {
|
|
11
|
+
private readonly weights;
|
|
12
|
+
private readonly metrics;
|
|
13
|
+
constructor(weights: ObjectWeights, metrics: ObjectMetrics);
|
|
14
|
+
get objectDensity(): number;
|
|
15
|
+
get objectGrouping(): number;
|
|
16
|
+
get objectDiversity(): number;
|
|
17
|
+
get minObjectsCount(): number;
|
|
18
|
+
get maxObjectsCount(): number;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=object-constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"object-constants.d.ts","sourceRoot":"","sources":["../../src/constants/object-constants.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,qBAAa,eAAe;IAC1B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAgB;IACxC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAgB;gBAE5B,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,aAAa;IAK1D,IAAI,aAAa,IAAI,MAAM,CAE1B;IAED,IAAI,cAAc,IAAI,MAAM,CAE3B;IAED,IAAI,eAAe,IAAI,MAAM,CAE5B;IAED,IAAI,eAAe,IAAI,MAAM,CAE5B;IAED,IAAI,eAAe,IAAI,MAAM,CAE5B;CACF"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export class ObjectConstants {
|
|
2
|
+
weights;
|
|
3
|
+
metrics;
|
|
4
|
+
constructor(weights, metrics) {
|
|
5
|
+
this.weights = weights;
|
|
6
|
+
this.metrics = metrics;
|
|
7
|
+
}
|
|
8
|
+
get objectDensity() {
|
|
9
|
+
return this.weights.density;
|
|
10
|
+
}
|
|
11
|
+
get objectGrouping() {
|
|
12
|
+
return this.weights.grouping;
|
|
13
|
+
}
|
|
14
|
+
get objectDiversity() {
|
|
15
|
+
return this.weights.diversity;
|
|
16
|
+
}
|
|
17
|
+
get minObjectsCount() {
|
|
18
|
+
return this.metrics.minAmount;
|
|
19
|
+
}
|
|
20
|
+
get maxObjectsCount() {
|
|
21
|
+
return this.metrics.maxAmount;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=object-constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"object-constants.js","sourceRoot":"","sources":["../../src/constants/object-constants.ts"],"names":[],"mappings":"AAWA,MAAM,OAAO,eAAe;IACT,OAAO,CAAgB;IACvB,OAAO,CAAgB;IAExC,YAAY,OAAsB,EAAE,OAAsB;QACxD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED,IAAI,aAAa;QACf,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;IAC9B,CAAC;IAED,IAAI,cAAc;QAChB,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC;IAC/B,CAAC;IAED,IAAI,eAAe;QACjB,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC;IAChC,CAAC;IAED,IAAI,eAAe;QACjB,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC;IAChC,CAAC;IAED,IAAI,eAAe;QACjB,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC;IAChC,CAAC;CACF"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export type PathWeights = {
|
|
2
|
+
turn: number;
|
|
3
|
+
accuracy: number;
|
|
4
|
+
};
|
|
5
|
+
export type PathMetrics = {
|
|
6
|
+
paths: number;
|
|
7
|
+
maxLength: number;
|
|
8
|
+
minLength: number;
|
|
9
|
+
maxTurns: number;
|
|
10
|
+
};
|
|
11
|
+
export declare class PathConstants {
|
|
12
|
+
private readonly weights;
|
|
13
|
+
private readonly metrics;
|
|
14
|
+
constructor(weights: PathWeights, metrics: PathMetrics);
|
|
15
|
+
get pathsCount(): number;
|
|
16
|
+
get maxPathLength(): number;
|
|
17
|
+
get minPathLength(): number;
|
|
18
|
+
get turnWeight(): number;
|
|
19
|
+
get accuracy(): number;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=path-constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"path-constants.d.ts","sourceRoot":"","sources":["../../src/constants/path-constants.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAc;IACtC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAc;gBAE1B,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW;IAKtD,IAAI,UAAU,IAAI,MAAM,CAEvB;IAED,IAAI,aAAa,IAAI,MAAM,CAE1B;IAED,IAAI,aAAa,IAAI,MAAM,CAE1B;IAED,IAAI,UAAU,IAAI,MAAM,CAEvB;IAED,IAAI,QAAQ,IAAI,MAAM,CAErB;CACF"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export class PathConstants {
|
|
2
|
+
weights;
|
|
3
|
+
metrics;
|
|
4
|
+
constructor(weights, metrics) {
|
|
5
|
+
this.weights = weights;
|
|
6
|
+
this.metrics = metrics;
|
|
7
|
+
}
|
|
8
|
+
get pathsCount() {
|
|
9
|
+
return this.metrics.paths;
|
|
10
|
+
}
|
|
11
|
+
get maxPathLength() {
|
|
12
|
+
return this.metrics.maxLength;
|
|
13
|
+
}
|
|
14
|
+
get minPathLength() {
|
|
15
|
+
return this.metrics.minLength;
|
|
16
|
+
}
|
|
17
|
+
get turnWeight() {
|
|
18
|
+
return this.weights.turn;
|
|
19
|
+
}
|
|
20
|
+
get accuracy() {
|
|
21
|
+
return this.weights.accuracy;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=path-constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"path-constants.js","sourceRoot":"","sources":["../../src/constants/path-constants.ts"],"names":[],"mappings":"AAYA,MAAM,OAAO,aAAa;IACP,OAAO,CAAc;IACrB,OAAO,CAAc;IAEtC,YAAY,OAAoB,EAAE,OAAoB;QACpD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;IAC5B,CAAC;IAED,IAAI,aAAa;QACf,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC;IAChC,CAAC;IAED,IAAI,aAAa;QACf,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC;IAChC,CAAC;IAED,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;IAC3B,CAAC;IAED,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC;IAC/B,CAAC;CACF"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Nullable, WithId, AnimatedSpriteData, AnimatedSpriteSetInit } from '../../types';
|
|
2
|
+
export declare class AnimatedSpriteSet<Sprite extends string> {
|
|
3
|
+
private map;
|
|
4
|
+
constructor(init: AnimatedSpriteSetInit<Sprite>);
|
|
5
|
+
getSprite(sprite: Sprite): Nullable<AnimatedSpriteData>;
|
|
6
|
+
getRandomSprite(): WithId<AnimatedSpriteData>;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=animated-sprite-set.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"animated-sprite-set.d.ts","sourceRoot":"","sources":["../../../src/spritesheet-set/animated-sprite/animated-sprite-set.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,QAAQ,EACR,MAAM,EACN,kBAAkB,EAClB,qBAAqB,EACtB,MAAM,aAAa,CAAC;AAGrB,qBAAa,iBAAiB,CAAC,MAAM,SAAS,MAAM;IAClD,OAAO,CAAC,GAAG,CAGP;gBAEQ,IAAI,EAAE,qBAAqB,CAAC,MAAM,CAAC;IAO/C,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ,CAAC,kBAAkB,CAAC;IAIvD,eAAe,IAAI,MAAM,CAAC,kBAAkB,CAAC;CAO9C"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { densityPick } from '../density-pick';
|
|
2
|
+
export class AnimatedSpriteSet {
|
|
3
|
+
map = new Map();
|
|
4
|
+
constructor(init) {
|
|
5
|
+
const { animatedSpriteMap } = init;
|
|
6
|
+
Object.entries(animatedSpriteMap).forEach(([key, element]) => {
|
|
7
|
+
this.map.set(key, element);
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
getSprite(sprite) {
|
|
11
|
+
return this.map.get(sprite);
|
|
12
|
+
}
|
|
13
|
+
getRandomSprite() {
|
|
14
|
+
const pick = densityPick(this.map);
|
|
15
|
+
return {
|
|
16
|
+
...pick.data,
|
|
17
|
+
id: pick.key,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=animated-sprite-set.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"animated-sprite-set.js","sourceRoot":"","sources":["../../../src/spritesheet-set/animated-sprite/animated-sprite-set.ts"],"names":[],"mappings":"AAMA,OAAO,EAAoB,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEhE,MAAM,OAAO,iBAAiB;IACpB,GAAG,GAAoC,IAAI,GAAG,EAGnD,CAAC;IAEJ,YAAY,IAAmC;QAC7C,MAAM,EAAE,iBAAiB,EAAE,GAAG,IAAI,CAAC;QACnC,MAAM,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,OAAO,CAAC,EAAE,EAAE;YAC3D,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAa,EAAE,OAA6B,CAAC,CAAC;QAC7D,CAAC,CAAC,CAAC;IACL,CAAC;IAED,SAAS,CAAC,MAAc;QACtB,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAC9B,CAAC;IAED,eAAe;QACb,MAAM,IAAI,GAAoC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACpE,OAAO;YACL,GAAG,IAAI,CAAC,IAAI;YACZ,EAAE,EAAE,IAAI,CAAC,GAAG;SACb,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { SpritesheetSet } from '../spritesheet-set.ts';
|
|
2
|
+
export declare class AnimatedSprite<Tile extends string> {
|
|
3
|
+
readonly key: string;
|
|
4
|
+
readonly fps: number;
|
|
5
|
+
readonly frames: SpritesheetSet<Tile>;
|
|
6
|
+
readonly animation: Tile[];
|
|
7
|
+
constructor(key: string, frames: SpritesheetSet<Tile>, fps: number, animation: Tile[]);
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=animated-sprite.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"animated-sprite.d.ts","sourceRoot":"","sources":["../../../src/spritesheet-set/animated-sprite/animated-sprite.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D,qBAAa,cAAc,CAAC,IAAI,SAAS,MAAM;IAC7C,SAAgB,GAAG,EAAE,MAAM,CAAC;IAC5B,SAAgB,GAAG,EAAE,MAAM,CAAC;IAC5B,SAAgB,MAAM,EAAE,cAAc,CAAC,IAAI,CAAC,CAAC;IAC7C,SAAgB,SAAS,EAAE,IAAI,EAAE,CAAC;gBAGhC,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,cAAc,CAAC,IAAI,CAAC,EAC5B,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,IAAI,EAAE;CAOpB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export class AnimatedSprite {
|
|
2
|
+
key;
|
|
3
|
+
fps;
|
|
4
|
+
frames;
|
|
5
|
+
animation;
|
|
6
|
+
constructor(key, frames, fps, animation) {
|
|
7
|
+
this.key = key;
|
|
8
|
+
this.fps = fps;
|
|
9
|
+
this.frames = frames;
|
|
10
|
+
this.animation = animation;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=animated-sprite.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"animated-sprite.js","sourceRoot":"","sources":["../../../src/spritesheet-set/animated-sprite/animated-sprite.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,cAAc;IACT,GAAG,CAAS;IACZ,GAAG,CAAS;IACZ,MAAM,CAAuB;IAC7B,SAAS,CAAS;IAElC,YACE,GAAW,EACX,MAA4B,EAC5B,GAAW,EACX,SAAiB;QAEjB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bushes-animation-set.d.ts","sourceRoot":"","sources":["../../../../src/spritesheet-set/animation-sets/bushes-set/bushes-animation-set.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAU9E,eAAO,MAAM,uBAAuB,mCAElC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AnimatedSpriteSet } from '../../animated-sprite/animated-sprite-set';
|
|
2
|
+
import { simpleBushSprite } from './simple-bush/simple-bush-sprite';
|
|
3
|
+
const bushesAnimatedSpriteSetMap = {
|
|
4
|
+
'regular-tree': {
|
|
5
|
+
sprite: simpleBushSprite,
|
|
6
|
+
density: 20,
|
|
7
|
+
},
|
|
8
|
+
};
|
|
9
|
+
export const BushesAnimatedSpriteSet = new AnimatedSpriteSet({
|
|
10
|
+
animatedSpriteMap: bushesAnimatedSpriteSetMap,
|
|
11
|
+
});
|
|
12
|
+
//# sourceMappingURL=bushes-animation-set.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bushes-animation-set.js","sourceRoot":"","sources":["../../../../src/spritesheet-set/animation-sets/bushes-set/bushes-animation-set.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAEpE,MAAM,0BAA0B,GAAG;IACjC,cAAc,EAAE;QACd,MAAM,EAAE,gBAAgB;QACxB,OAAO,EAAE,EAAE;KACZ;CACyC,CAAC;AAE7C,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,iBAAiB,CAAC;IAC3D,iBAAiB,EAAE,0BAA0B;CAC9C,CAAC,CAAC"}
|
package/dist/spritesheet-set/animation-sets/bushes-set/simple-bush/simple-bush-sprite.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"simple-bush-sprite.d.ts","sourceRoot":"","sources":["../../../../../src/spritesheet-set/animation-sets/bushes-set/simple-bush/simple-bush-sprite.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AA2B1E,eAAO,MAAM,gBAAgB,uCAK5B,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { SpritesheetSet } from '../../../spritesheet-set';
|
|
2
|
+
import { AnimatedSprite } from '../../../animated-sprite/animated-sprite';
|
|
3
|
+
const simpleBushSpritesheetMap = {
|
|
4
|
+
'frame-1': {
|
|
5
|
+
x: 0,
|
|
6
|
+
y: 0,
|
|
7
|
+
width: 32,
|
|
8
|
+
height: 32,
|
|
9
|
+
density: 10,
|
|
10
|
+
},
|
|
11
|
+
'frame-2': {
|
|
12
|
+
x: 0,
|
|
13
|
+
y: 32,
|
|
14
|
+
width: 32,
|
|
15
|
+
height: 32,
|
|
16
|
+
density: 10,
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
const SimpleBushSpritesheetSet = new SpritesheetSet({
|
|
20
|
+
spritesheetKey: 'simple-bush-sprite-set',
|
|
21
|
+
spritesheetPath: 'animation-spritesheet',
|
|
22
|
+
spritesheetMap: simpleBushSpritesheetMap,
|
|
23
|
+
});
|
|
24
|
+
export const simpleBushSprite = new AnimatedSprite('simple-bush', SimpleBushSpritesheetSet, 2, ['frame-1', 'frame-2']);
|
|
25
|
+
//# sourceMappingURL=simple-bush-sprite.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"simple-bush-sprite.js","sourceRoot":"","sources":["../../../../../src/spritesheet-set/animation-sets/bushes-set/simple-bush/simple-bush-sprite.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAE1E,MAAM,wBAAwB,GAAG;IAC/B,SAAS,EAAE;QACT,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,CAAC;QACJ,KAAK,EAAE,EAAE;QACT,MAAM,EAAE,EAAE;QACV,OAAO,EAAE,EAAE;KACZ;IACD,SAAS,EAAE;QACT,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,EAAE;QACL,KAAK,EAAE,EAAE;QACT,MAAM,EAAE,EAAE;QACV,OAAO,EAAE,EAAE;KACZ;CACmC,CAAC;AAIvC,MAAM,wBAAwB,GAAG,IAAI,cAAc,CAAC;IAClD,cAAc,EAAE,wBAAwB;IACxC,eAAe,EAAE,uBAAuB;IACxC,cAAc,EAAE,wBAAwB;CACzC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,cAAc,CAChD,aAAa,EACb,wBAAwB,EACxB,CAAC,EACD,CAAC,SAAS,EAAE,SAAS,CAAC,CACvB,CAAC"}
|
package/dist/spritesheet-set/animation-sets/trees-set/regular-tree/regular-tree-sprite.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"regular-tree-sprite.d.ts","sourceRoot":"","sources":["../../../../../src/spritesheet-set/animation-sets/trees-set/regular-tree/regular-tree-sprite.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AA2B1E,eAAO,MAAM,iBAAiB,uCAK7B,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { SpritesheetSet } from '../../../spritesheet-set';
|
|
2
|
+
import { AnimatedSprite } from '../../../animated-sprite/animated-sprite';
|
|
3
|
+
const regularTreeSpritesheetMap = {
|
|
4
|
+
'frame-1': {
|
|
5
|
+
x: 32,
|
|
6
|
+
y: 0,
|
|
7
|
+
width: 68,
|
|
8
|
+
height: 68,
|
|
9
|
+
density: 10,
|
|
10
|
+
},
|
|
11
|
+
'frame-2': {
|
|
12
|
+
x: 32,
|
|
13
|
+
y: 68,
|
|
14
|
+
width: 68,
|
|
15
|
+
height: 68,
|
|
16
|
+
density: 10,
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
const RegularTreeSpritesheetSet = new SpritesheetSet({
|
|
20
|
+
spritesheetKey: 'regular-tree-sprite-set',
|
|
21
|
+
spritesheetPath: 'animation-spritesheet',
|
|
22
|
+
spritesheetMap: regularTreeSpritesheetMap,
|
|
23
|
+
});
|
|
24
|
+
export const regularTreeSprite = new AnimatedSprite('regular-tree', RegularTreeSpritesheetSet, 2, ['frame-1', 'frame-2']);
|
|
25
|
+
//# sourceMappingURL=regular-tree-sprite.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"regular-tree-sprite.js","sourceRoot":"","sources":["../../../../../src/spritesheet-set/animation-sets/trees-set/regular-tree/regular-tree-sprite.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAE1E,MAAM,yBAAyB,GAAG;IAChC,SAAS,EAAE;QACT,CAAC,EAAE,EAAE;QACL,CAAC,EAAE,CAAC;QACJ,KAAK,EAAE,EAAE;QACT,MAAM,EAAE,EAAE;QACV,OAAO,EAAE,EAAE;KACZ;IACD,SAAS,EAAE;QACT,CAAC,EAAE,EAAE;QACL,CAAC,EAAE,EAAE;QACL,KAAK,EAAE,EAAE;QACT,MAAM,EAAE,EAAE;QACV,OAAO,EAAE,EAAE;KACZ;CACmC,CAAC;AAIvC,MAAM,yBAAyB,GAAG,IAAI,cAAc,CAAC;IACnD,cAAc,EAAE,yBAAyB;IACzC,eAAe,EAAE,uBAAuB;IACxC,cAAc,EAAE,yBAAyB;CAC1C,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,cAAc,CACjD,cAAc,EACd,yBAAyB,EACzB,CAAC,EACD,CAAC,SAAS,EAAE,SAAS,CAAC,CACvB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trees-animation-set.d.ts","sourceRoot":"","sources":["../../../../src/spritesheet-set/animation-sets/trees-set/trees-animation-set.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAU9E,eAAO,MAAM,sBAAsB,mCAEjC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AnimatedSpriteSet } from '../../animated-sprite/animated-sprite-set';
|
|
2
|
+
import { regularTreeSprite } from './regular-tree/regular-tree-sprite';
|
|
3
|
+
const treesAnimatedSpriteSetMap = {
|
|
4
|
+
'regular-tree': {
|
|
5
|
+
sprite: regularTreeSprite,
|
|
6
|
+
density: 20,
|
|
7
|
+
},
|
|
8
|
+
};
|
|
9
|
+
export const TreesAnimatedSpriteSet = new AnimatedSpriteSet({
|
|
10
|
+
animatedSpriteMap: treesAnimatedSpriteSetMap,
|
|
11
|
+
});
|
|
12
|
+
//# sourceMappingURL=trees-animation-set.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trees-animation-set.js","sourceRoot":"","sources":["../../../../src/spritesheet-set/animation-sets/trees-set/trees-animation-set.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAEvE,MAAM,yBAAyB,GAAG;IAChC,cAAc,EAAE;QACd,MAAM,EAAE,iBAAiB;QACzB,OAAO,EAAE,EAAE;KACZ;CACyC,CAAC;AAE7C,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,iBAAiB,CAAC;IAC1D,iBAAiB,EAAE,yBAAyB;CAC7C,CAAC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { WithDensity } from '../types';
|
|
2
|
+
export type DensityPick<Data> = {
|
|
3
|
+
data: WithDensity<Data>;
|
|
4
|
+
key: string;
|
|
5
|
+
};
|
|
6
|
+
export declare const densityPick: <Data>(map: Map<string, WithDensity<Data>>) => DensityPick<Data>;
|
|
7
|
+
//# sourceMappingURL=density-pick.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"density-pick.d.ts","sourceRoot":"","sources":["../../src/spritesheet-set/density-pick.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,MAAM,MAAM,WAAW,CAAC,IAAI,IAAI;IAC9B,IAAI,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC;IACxB,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,IAAI,EAC9B,KAAK,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC,KAClC,WAAW,CAAC,IAAI,CA6BlB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export const densityPick = (map) => {
|
|
2
|
+
const entries = Array.from(map.entries()).filter(([_, element]) => element.density && element.density > 0);
|
|
3
|
+
const totalDensity = entries.reduce((sum, [_, el]) => sum + el.density, 0);
|
|
4
|
+
const randomValue = Math.random() * totalDensity;
|
|
5
|
+
let cumulative = 0;
|
|
6
|
+
for (const [key, element] of entries) {
|
|
7
|
+
cumulative += element.density;
|
|
8
|
+
if (randomValue < cumulative) {
|
|
9
|
+
return {
|
|
10
|
+
data: element,
|
|
11
|
+
key,
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
// fallback (should theoretically never happen)
|
|
16
|
+
return {
|
|
17
|
+
data: entries[entries.length - 1][1],
|
|
18
|
+
key: entries[entries.length - 1][0],
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=density-pick.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"density-pick.js","sourceRoot":"","sources":["../../src/spritesheet-set/density-pick.ts"],"names":[],"mappings":"AAOA,MAAM,CAAC,MAAM,WAAW,GAAG,CACzB,GAAmC,EAChB,EAAE;IACrB,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC,MAAM,CAC9C,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,OAAO,GAAG,CAAC,CACzD,CAAC;IAEF,MAAM,YAAY,GAAG,OAAO,CAAC,MAAM,CACjC,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,GAAI,EAAE,CAAC,OAAkB,EAC9C,CAAC,CACF,CAAC;IAEF,MAAM,WAAW,GAAW,IAAI,CAAC,MAAM,EAAE,GAAG,YAAY,CAAC;IAEzD,IAAI,UAAU,GAAG,CAAC,CAAC;IAEnB,KAAK,MAAM,CAAC,GAAG,EAAE,OAAO,CAAC,IAAI,OAAO,EAAE,CAAC;QACrC,UAAU,IAAI,OAAO,CAAC,OAAiB,CAAC;QACxC,IAAI,WAAW,GAAG,UAAU,EAAE,CAAC;YAC7B,OAAO;gBACL,IAAI,EAAE,OAAO;gBACb,GAAG;aACJ,CAAC;QACJ,CAAC;IACH,CAAC;IAED,+CAA+C;IAC/C,OAAO;QACL,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QACpC,GAAG,EAAE,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;KACpC,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { SpritesheetSet } from './spritesheet-set';
|
|
2
|
+
export { DecorationsSpritesheetSet, type DecorationSpreadsheetElementKey, } from './sets/decorations-set';
|
|
3
|
+
export { TilesSpritesheetSet, pathTilesDirections, type TileSpritesheetElementKey, type TilePathSpritesheetElementKey, } from './sets/tiles-set';
|
|
4
|
+
export { StonesSpritesheetSet, type StoneSpritesheetElementKey, } from './sets/stones-set';
|
|
5
|
+
export { TreesAnimatedSpriteSet } from './animation-sets/trees-set/trees-animation-set';
|
|
6
|
+
export { BushesAnimatedSpriteSet } from './animation-sets/bushes-set/bushes-animation-set';
|
|
7
|
+
export { AnimatedSprite } from './animated-sprite/animated-sprite';
|
|
8
|
+
export { AnimatedSpriteSet } from './animated-sprite/animated-sprite-set';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/spritesheet-set/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EACL,yBAAyB,EACzB,KAAK,+BAA+B,GACrC,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,KAAK,yBAAyB,EAC9B,KAAK,6BAA6B,GACnC,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,oBAAoB,EACpB,KAAK,0BAA0B,GAChC,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,sBAAsB,EAAE,MAAM,gDAAgD,CAAC;AACxF,OAAO,EAAE,uBAAuB,EAAE,MAAM,kDAAkD,CAAC;AAC3F,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { SpritesheetSet } from './spritesheet-set';
|
|
2
|
+
export { DecorationsSpritesheetSet, } from './sets/decorations-set';
|
|
3
|
+
export { TilesSpritesheetSet, pathTilesDirections, } from './sets/tiles-set';
|
|
4
|
+
export { StonesSpritesheetSet, } from './sets/stones-set';
|
|
5
|
+
export { TreesAnimatedSpriteSet } from './animation-sets/trees-set/trees-animation-set';
|
|
6
|
+
export { BushesAnimatedSpriteSet } from './animation-sets/bushes-set/bushes-animation-set';
|
|
7
|
+
export { AnimatedSprite } from './animated-sprite/animated-sprite';
|
|
8
|
+
export { AnimatedSpriteSet } from './animated-sprite/animated-sprite-set';
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/spritesheet-set/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EACL,yBAAyB,GAE1B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,mBAAmB,EACnB,mBAAmB,GAGpB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,oBAAoB,GAErB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,sBAAsB,EAAE,MAAM,gDAAgD,CAAC;AACxF,OAAO,EAAE,uBAAuB,EAAE,MAAM,kDAAkD,CAAC;AAC3F,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC"}
|