sonolus-bandori-engine 1.3.0 → 1.4.0-alpha.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 CHANGED
@@ -49,57 +49,33 @@ npm install sonolus-bandori-engine
49
49
 
50
50
  Package version.
51
51
 
52
- ### `engineInfo`
52
+ ### `databaseEngineItem`
53
53
 
54
- Partial engine information compatible with [sonolus-express](https://github.com/NonSpicyBurrito/sonolus-express).
54
+ Partial database engine item compatible with [sonolus-express](https://github.com/NonSpicyBurrito/sonolus-express).
55
55
 
56
- ### `engineConfiguration`
56
+ ### `engineConfigurationPath`
57
57
 
58
- Engine Configuration.
58
+ Path to Engine Configuration file.
59
59
 
60
- - `engineConfiguration.path`: path to file.
61
- - `engineConfiguration.buffer`: buffer of file.
62
- - `engineConfiguration.hash`: hash of file.
60
+ ### `enginePlayDataPath`
63
61
 
64
- ### `enginePlayData`
62
+ Path to Engine Play Data file.
65
63
 
66
- Engine Play Data.
64
+ ### `engineWatchDataPath`
67
65
 
68
- - `enginePlayData.path`: path to file.
69
- - `enginePlayData.buffer`: buffer of file.
70
- - `enginePlayData.hash`: hash of file.
66
+ Path to Engine Watch Data file.
71
67
 
72
- ### `engineWatchData`
68
+ ### `enginePreviewDataPath`
73
69
 
74
- Engine Watch Data.
70
+ Path to Engine Preview Data file.
75
71
 
76
- - `engineWatchData.path`: path to file.
77
- - `engineWatchData.buffer`: buffer of file.
78
- - `engineWatchData.hash`: hash of file.
72
+ ### `engineTutorialDataPath`
79
73
 
80
- ### `enginePreviewData`
74
+ Path to Engine Tutorial Data file.
81
75
 
82
- Engine Preview Data.
76
+ ### `engineThumbnailPath`
83
77
 
84
- - `enginePreviewData.path`: path to file.
85
- - `enginePreviewData.buffer`: buffer of file.
86
- - `enginePreviewData.hash`: hash of file.
87
-
88
- ### `engineTutorialData`
89
-
90
- Engine Tutorial Data.
91
-
92
- - `engineTutorialData.path`: path to file.
93
- - `engineTutorialData.buffer`: buffer of file.
94
- - `engineTutorialData.hash`: hash of file.
95
-
96
- ### `engineThumbnail`
97
-
98
- Engine Thumbnail.
99
-
100
- - `engineThumbnail.path`: path to file.
101
- - `engineThumbnail.buffer`: buffer of file.
102
- - `engineThumbnail.hash`: hash of file.
78
+ Path to Engine Thumbnail file.
103
79
 
104
80
  ### `bestdoriToLevelData(chart, offset?)`
105
81
 
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -16,7 +16,7 @@ function bestdoriToLevelData(chart, offset = 0) {
16
16
  intermediateToRef.set(intermediate, ref);
17
17
  const entity = intermediateToEntity.get(intermediate);
18
18
  if (entity)
19
- entity.ref = ref;
19
+ entity.name = ref;
20
20
  return ref;
21
21
  };
22
22
  const append = (intermediate) => {
@@ -38,7 +38,7 @@ function bestdoriToLevelData(chart, offset = 0) {
38
38
  }
39
39
  const ref = intermediateToRef.get(intermediate);
40
40
  if (ref)
41
- entity.ref = ref;
41
+ entity.name = ref;
42
42
  intermediateToEntity.set(intermediate, entity);
43
43
  entities.push(entity);
44
44
  for (const [name, value] of Object.entries(intermediate.data)) {
@@ -61,11 +61,6 @@ function bestdoriToLevelData(chart, offset = 0) {
61
61
  data: {},
62
62
  sim: false,
63
63
  });
64
- append({
65
- archetype: 'InputManager',
66
- data: {},
67
- sim: false,
68
- });
69
64
  append({
70
65
  archetype: 'Stage',
71
66
  data: {},
@@ -126,9 +121,11 @@ const directional = (object, append) => {
126
121
  });
127
122
  };
128
123
  const longAndSlide = (object, append) => {
124
+ let first;
129
125
  let start;
130
126
  let head;
131
127
  const connectors = [];
128
+ const appends = [];
132
129
  const connectorArchetype = object.connections
133
130
  .slice(1, -1)
134
131
  .some((connection) => connection.hidden)
@@ -136,17 +133,22 @@ const longAndSlide = (object, append) => {
136
133
  : 'StraightSlideConnector';
137
134
  for (const [i, connection] of object.connections.entries()) {
138
135
  if (i === 0) {
139
- start = head = {
140
- archetype: 'SlideStartNote',
141
- data: {
142
- [sonolus_core_1.EngineArchetypeDataName.Beat]: connection.beat,
143
- lane: connection.lane - 3,
144
- },
145
- sim: true,
146
- };
147
- append(start);
136
+ first =
137
+ start =
138
+ head =
139
+ {
140
+ archetype: 'SlideStartNote',
141
+ data: {
142
+ [sonolus_core_1.EngineArchetypeDataName.Beat]: connection.beat,
143
+ lane: connection.lane - 3,
144
+ },
145
+ sim: true,
146
+ };
147
+ appends.push(first);
148
148
  continue;
149
149
  }
150
+ if (!first)
151
+ throw new Error('Unexpected missing first');
150
152
  if (!start)
151
153
  throw new Error('Unexpected missing start');
152
154
  if (!head)
@@ -157,6 +159,7 @@ const longAndSlide = (object, append) => {
157
159
  data: {
158
160
  [sonolus_core_1.EngineArchetypeDataName.Beat]: connection.beat,
159
161
  lane: connection.lane - 3,
162
+ first,
160
163
  prev: start,
161
164
  },
162
165
  sim: true,
@@ -165,10 +168,12 @@ const longAndSlide = (object, append) => {
165
168
  tail.data.long =
166
169
  object.connections.length === 2 && head.data.lane === tail.data.lane ? 1 : 0;
167
170
  }
168
- append(tail);
171
+ appends.push(tail);
172
+ first.data.last = tail;
169
173
  connectors.push({
170
174
  archetype: connectorArchetype,
171
175
  data: {
176
+ first,
172
177
  start,
173
178
  head,
174
179
  tail,
@@ -177,8 +182,8 @@ const longAndSlide = (object, append) => {
177
182
  });
178
183
  for (const connector of connectors) {
179
184
  connector.data.end = tail;
180
- append(connector);
181
185
  }
186
+ appends.push(...connectors);
182
187
  connectors.length = 0;
183
188
  continue;
184
189
  }
@@ -191,10 +196,11 @@ const longAndSlide = (object, append) => {
191
196
  },
192
197
  sim: false,
193
198
  };
194
- append(tail);
199
+ appends.push(tail);
195
200
  connectors.push({
196
201
  archetype: connectorArchetype,
197
202
  data: {
203
+ first,
198
204
  start,
199
205
  head,
200
206
  tail,
@@ -209,14 +215,16 @@ const longAndSlide = (object, append) => {
209
215
  data: {
210
216
  [sonolus_core_1.EngineArchetypeDataName.Beat]: connection.beat,
211
217
  lane: connection.lane - 3,
218
+ first,
212
219
  prev: start,
213
220
  },
214
221
  sim: false,
215
222
  };
216
- append(tail);
223
+ appends.push(tail);
217
224
  connectors.push({
218
225
  archetype: connectorArchetype,
219
226
  data: {
227
+ first,
220
228
  start,
221
229
  head,
222
230
  tail,
@@ -225,11 +233,14 @@ const longAndSlide = (object, append) => {
225
233
  });
226
234
  for (const connector of connectors) {
227
235
  connector.data.end = tail;
228
- append(connector);
229
236
  }
237
+ appends.push(...connectors);
230
238
  connectors.length = 0;
231
239
  start = head = tail;
232
240
  }
241
+ for (const intermediate of appends) {
242
+ append(intermediate);
243
+ }
233
244
  };
234
245
  const system = () => {
235
246
  // noop
package/dist/index.cjs CHANGED
@@ -14,15 +14,15 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.engineThumbnail = exports.engineTutorialData = exports.enginePreviewData = exports.engineWatchData = exports.enginePlayData = exports.engineConfiguration = exports.engineInfo = exports.version = exports.bestdoriToLevelData = void 0;
18
- const Resource_cjs_1 = require("./Resource.cjs");
17
+ exports.engineThumbnailPath = exports.engineTutorialDataPath = exports.enginePreviewDataPath = exports.engineWatchDataPath = exports.enginePlayDataPath = exports.engineConfigurationPath = exports.databaseEngineItem = exports.version = exports.bestdoriToLevelData = void 0;
18
+ const node_path_1 = require("node:path");
19
19
  var convert_cjs_1 = require("./bestdori/convert.cjs");
20
20
  Object.defineProperty(exports, "bestdoriToLevelData", { enumerable: true, get: function () { return convert_cjs_1.bestdoriToLevelData; } });
21
21
  __exportStar(require("./bestdori/index.cjs"), exports);
22
- exports.version = '1.3.0';
23
- exports.engineInfo = {
22
+ exports.version = '1.4.0-alpha.1';
23
+ exports.databaseEngineItem = {
24
24
  name: 'bandori',
25
- version: 11,
25
+ version: 12,
26
26
  title: {
27
27
  en: 'BanG Dream!',
28
28
  ja: 'バンドリ!',
@@ -52,9 +52,9 @@ exports.engineInfo = {
52
52
  ].join('\n'),
53
53
  },
54
54
  };
55
- exports.engineConfiguration = new Resource_cjs_1.Resource('EngineConfiguration');
56
- exports.enginePlayData = new Resource_cjs_1.Resource('EnginePlayData');
57
- exports.engineWatchData = new Resource_cjs_1.Resource('EngineWatchData');
58
- exports.enginePreviewData = new Resource_cjs_1.Resource('EnginePreviewData');
59
- exports.engineTutorialData = new Resource_cjs_1.Resource('EngineTutorialData');
60
- exports.engineThumbnail = new Resource_cjs_1.Resource('thumbnail.png');
55
+ exports.engineConfigurationPath = (0, node_path_1.resolve)(__dirname, 'EngineConfiguration');
56
+ exports.enginePlayDataPath = (0, node_path_1.resolve)(__dirname, 'EnginePlayData');
57
+ exports.engineWatchDataPath = (0, node_path_1.resolve)(__dirname, 'EngineWatchData');
58
+ exports.enginePreviewDataPath = (0, node_path_1.resolve)(__dirname, 'EnginePreviewData');
59
+ exports.engineTutorialDataPath = (0, node_path_1.resolve)(__dirname, 'EngineTutorialData');
60
+ exports.engineThumbnailPath = (0, node_path_1.resolve)(__dirname, 'thumbnail.png');
package/dist/index.d.cts CHANGED
@@ -1,10 +1,9 @@
1
- import { Resource } from './Resource.cjs';
2
1
  export { bestdoriToLevelData } from './bestdori/convert.cjs';
3
2
  export * from './bestdori/index.cjs';
4
- export declare const version = "1.3.0";
5
- export declare const engineInfo: {
3
+ export declare const version = "1.4.0-alpha.1";
4
+ export declare const databaseEngineItem: {
6
5
  readonly name: "bandori";
7
- readonly version: 11;
6
+ readonly version: 12;
8
7
  readonly title: {
9
8
  readonly en: "BanG Dream!";
10
9
  readonly ja: "バンドリ!";
@@ -26,9 +25,9 @@ export declare const engineInfo: {
26
25
  readonly en: string;
27
26
  };
28
27
  };
29
- export declare const engineConfiguration: Resource;
30
- export declare const enginePlayData: Resource;
31
- export declare const engineWatchData: Resource;
32
- export declare const enginePreviewData: Resource;
33
- export declare const engineTutorialData: Resource;
34
- export declare const engineThumbnail: Resource;
28
+ export declare const engineConfigurationPath: string;
29
+ export declare const enginePlayDataPath: string;
30
+ export declare const engineWatchDataPath: string;
31
+ export declare const enginePreviewDataPath: string;
32
+ export declare const engineTutorialDataPath: string;
33
+ export declare const engineThumbnailPath: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sonolus-bandori-engine",
3
- "version": "1.3.0",
3
+ "version": "1.4.0-alpha.1",
4
4
  "description": "A recreation of BanG Dream! Girls Band Party engine in Sonolus",
5
5
  "author": "NonSpicyBurrito",
6
6
  "repository": "github:NonSpicyBurrito/sonolus-bandori-engine",
@@ -21,17 +21,17 @@
21
21
  "build": "tsc -p ./lib && sonolus-cli --build ./play && sonolus-cli --build ./watch && sonolus-cli --build ./preview && sonolus-cli --build ./tutorial && node ./lib/build.mjs"
22
22
  },
23
23
  "dependencies": {
24
- "sonolus-core": "~7.4.0"
24
+ "sonolus-core": "7.5.0-alpha.4"
25
25
  },
26
26
  "devDependencies": {
27
- "@types/node": "^16.18.65",
28
- "@typescript-eslint/eslint-plugin": "^6.12.0",
29
- "@typescript-eslint/parser": "^6.12.0",
30
- "eslint": "^8.54.0",
31
- "eslint-config-prettier": "^9.0.0",
32
- "prettier": "^3.1.0",
27
+ "@types/node": "^16.18.68",
28
+ "@typescript-eslint/eslint-plugin": "^6.14.0",
29
+ "@typescript-eslint/parser": "^6.14.0",
30
+ "eslint": "^8.55.0",
31
+ "eslint-config-prettier": "^9.1.0",
32
+ "prettier": "^3.1.1",
33
33
  "prettier-plugin-organize-imports": "^3.2.4",
34
- "sonolus.js": "~9.3.0",
35
- "typescript": "~5.2.2"
34
+ "sonolus.js": "9.4.0-alpha.3",
35
+ "typescript": "~5.3.3"
36
36
  }
37
37
  }
package/dist/Resource.cjs DELETED
@@ -1,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Resource = void 0;
4
- const node_crypto_1 = require("node:crypto");
5
- const node_fs_1 = require("node:fs");
6
- const node_path_1 = require("node:path");
7
- class Resource {
8
- constructor(path) {
9
- this.path = (0, node_path_1.resolve)(__dirname, path);
10
- }
11
- get hash() {
12
- this._hash ??= (0, node_crypto_1.createHash)('sha1').update(this.buffer).digest('hex');
13
- return this._hash;
14
- }
15
- get buffer() {
16
- this._buffer ??= (0, node_fs_1.readFileSync)(this.path);
17
- return this._buffer;
18
- }
19
- }
20
- exports.Resource = Resource;
@@ -1,9 +0,0 @@
1
- /// <reference types="node" />
2
- export declare class Resource {
3
- readonly path: string;
4
- private _hash;
5
- private _buffer;
6
- constructor(path: string);
7
- get hash(): string;
8
- get buffer(): Buffer;
9
- }