mirror of
https://github.com/tobspr/shapez.io.git
synced 2024-10-27 20:34:29 +00:00
33 lines
780 B
JavaScript
33 lines
780 B
JavaScript
import { Component } from "../component";
|
|
import { ShapeDefinition } from "../shape_definition";
|
|
import { types } from "../../savegame/serialization";
|
|
|
|
export class HubComponent extends Component {
|
|
static getId() {
|
|
return "Hub";
|
|
}
|
|
|
|
static getSchema() {
|
|
return {
|
|
definitionsToAnalyze: types.array(types.knownType(ShapeDefinition)),
|
|
};
|
|
}
|
|
|
|
constructor() {
|
|
super();
|
|
|
|
/**
|
|
* Shape definitions in queue to be analyzed and counted towards the goal
|
|
* @type {Array<ShapeDefinition>}
|
|
*/
|
|
this.definitionsToAnalyze = [];
|
|
}
|
|
|
|
/**
|
|
* @param {ShapeDefinition} definition
|
|
*/
|
|
queueShapeDefinition(definition) {
|
|
this.definitionsToAnalyze.push(definition);
|
|
}
|
|
}
|