sonolus-deemo-engine 1.0.0 → 1.0.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.
- package/README.md +4 -4
- package/dist/dc/index.d.cts +7 -7
- package/dist/{chart → ds}/convert.cjs +5 -5
- package/dist/ds/convert.d.cts +3 -0
- package/dist/{chart → ds}/index.d.cts +5 -5
- package/dist/index.cjs +22 -6
- package/dist/index.d.cts +4 -2
- package/package.json +1 -1
- package/dist/chart/convert.d.cts +0 -3
- /package/dist/{chart → ds}/index.cjs +0 -0
package/README.md
CHANGED
|
@@ -47,15 +47,15 @@ Engine Thumbnail.
|
|
|
47
47
|
- `engineThumbnail.buffer`: buffer of file.
|
|
48
48
|
- `engineThumbnail.hash`: hash of file.
|
|
49
49
|
|
|
50
|
-
### `
|
|
50
|
+
### `dsToDC(ds)`
|
|
51
51
|
|
|
52
|
-
Converts Deemo
|
|
52
|
+
Converts DS (Deemo Source) to DC (Deemo Chart).
|
|
53
53
|
|
|
54
|
-
- `
|
|
54
|
+
- `ds`: Deemo Source.
|
|
55
55
|
|
|
56
56
|
### `dcToLevelData(dc, offset?)`
|
|
57
57
|
|
|
58
58
|
Converts DC (Deemo Chart) to Level Data.
|
|
59
59
|
|
|
60
|
-
- `dc`: Deemo
|
|
60
|
+
- `dc`: Deemo Chart.
|
|
61
61
|
- `offset`: offset (default: `0`).
|
package/dist/dc/index.d.cts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
export type DC =
|
|
2
|
-
export type
|
|
3
|
-
type
|
|
1
|
+
export type DC = DCObject[];
|
|
2
|
+
export type DCObject = DCBPMChangeObject | DCTapNote | DCSlideNote;
|
|
3
|
+
type BaseDCObject = {
|
|
4
4
|
beat: number;
|
|
5
5
|
};
|
|
6
|
-
export type
|
|
6
|
+
export type DCBPMChangeObject = BaseDCObject & {
|
|
7
7
|
type: 'bpm';
|
|
8
8
|
bpm: number;
|
|
9
9
|
};
|
|
10
|
-
type
|
|
10
|
+
type BaseDCNote = BaseDCObject & {
|
|
11
11
|
lane: number;
|
|
12
12
|
size: number;
|
|
13
13
|
};
|
|
14
|
-
export type
|
|
14
|
+
export type DCTapNote = BaseDCNote & {
|
|
15
15
|
type: 'tap';
|
|
16
16
|
};
|
|
17
|
-
export type
|
|
17
|
+
export type DCSlideNote = BaseDCNote & {
|
|
18
18
|
type: 'slide';
|
|
19
19
|
};
|
|
20
20
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
const
|
|
3
|
+
exports.dsToDC = void 0;
|
|
4
|
+
const dsToDC = (ds) => {
|
|
5
5
|
const dc = [
|
|
6
6
|
{
|
|
7
7
|
type: 'bpm',
|
|
@@ -9,8 +9,8 @@ const chartToDC = (chart) => {
|
|
|
9
9
|
bpm: 60,
|
|
10
10
|
},
|
|
11
11
|
];
|
|
12
|
-
const slideIds =
|
|
13
|
-
for (const note of
|
|
12
|
+
const slideIds = ds.links.flatMap((link) => link.notes.map((note) => note.$ref));
|
|
13
|
+
for (const note of ds.notes) {
|
|
14
14
|
if (note.pos > 2)
|
|
15
15
|
continue;
|
|
16
16
|
dc.push({
|
|
@@ -22,4 +22,4 @@ const chartToDC = (chart) => {
|
|
|
22
22
|
}
|
|
23
23
|
return dc;
|
|
24
24
|
};
|
|
25
|
-
exports.
|
|
25
|
+
exports.dsToDC = dsToDC;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
export type
|
|
2
|
-
notes:
|
|
3
|
-
links:
|
|
1
|
+
export type DS = {
|
|
2
|
+
notes: DSNote[];
|
|
3
|
+
links: DSLink[];
|
|
4
4
|
};
|
|
5
|
-
export type
|
|
5
|
+
export type DSNote = {
|
|
6
6
|
$id: string;
|
|
7
7
|
pos: number;
|
|
8
8
|
size: number;
|
|
9
9
|
time: number;
|
|
10
10
|
};
|
|
11
|
-
export type
|
|
11
|
+
export type DSLink = {
|
|
12
12
|
notes: {
|
|
13
13
|
$ref: string;
|
|
14
14
|
}[];
|
package/dist/index.cjs
CHANGED
|
@@ -1,12 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.engineThumbnail = exports.engineData = exports.engineConfiguration = exports.engineInfo = exports.version = exports.
|
|
17
|
+
exports.engineThumbnail = exports.engineData = exports.engineConfiguration = exports.engineInfo = exports.version = exports.dsToDC = exports.dcToLevelData = void 0;
|
|
4
18
|
const Resource_cjs_1 = require("./Resource.cjs");
|
|
5
|
-
var convert_cjs_1 = require("./
|
|
6
|
-
Object.defineProperty(exports, "
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
exports
|
|
19
|
+
var convert_cjs_1 = require("./dc/convert.cjs");
|
|
20
|
+
Object.defineProperty(exports, "dcToLevelData", { enumerable: true, get: function () { return convert_cjs_1.dcToLevelData; } });
|
|
21
|
+
__exportStar(require("./dc/index.cjs"), exports);
|
|
22
|
+
var convert_cjs_2 = require("./ds/convert.cjs");
|
|
23
|
+
Object.defineProperty(exports, "dsToDC", { enumerable: true, get: function () { return convert_cjs_2.dsToDC; } });
|
|
24
|
+
__exportStar(require("./ds/index.cjs"), exports);
|
|
25
|
+
exports.version = '1.0.1';
|
|
10
26
|
exports.engineInfo = {
|
|
11
27
|
name: 'deemo',
|
|
12
28
|
version: 8,
|
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { Resource } from './Resource.cjs';
|
|
2
|
-
export { chartToDC } from './chart/convert.cjs';
|
|
3
2
|
export { dcToLevelData } from './dc/convert.cjs';
|
|
4
|
-
export
|
|
3
|
+
export * from './dc/index.cjs';
|
|
4
|
+
export { dsToDC } from './ds/convert.cjs';
|
|
5
|
+
export * from './ds/index.cjs';
|
|
6
|
+
export declare const version = "1.0.1";
|
|
5
7
|
export declare const engineInfo: {
|
|
6
8
|
readonly name: "deemo";
|
|
7
9
|
readonly version: 8;
|
package/package.json
CHANGED
package/dist/chart/convert.d.cts
DELETED
|
File without changes
|