1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2025-06-09 11:04:03 +00:00
tobspr_shapez.io/src/js/game/components/hub.js

33 lines
780 B
JavaScript
Raw Normal View History

2020-05-09 14:45:23 +00:00
import { Component } from "../component";
import { ShapeDefinition } from "../shape_definition";
2020-05-14 19:54:11 +00:00
import { types } from "../../savegame/serialization";
2020-05-09 14:45:23 +00:00
export class HubComponent extends Component {
static getId() {
return "Hub";
}
2020-05-14 19:54:11 +00:00
static getSchema() {
return {
definitionsToAnalyze: types.array(types.knownType(ShapeDefinition)),
};
}
2020-05-09 14:45:23 +00:00
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);
}
}