mirror of
https://github.com/tobspr/shapez.io.git
synced 2026-03-02 03:39:21 +00:00
Add belt reader building
This commit is contained in:
40
src/js/game/components/belt_reader.js
Normal file
40
src/js/game/components/belt_reader.js
Normal file
@@ -0,0 +1,40 @@
|
||||
import { Component } from "../component";
|
||||
import { BaseItem } from "../base_item";
|
||||
|
||||
export class BeltReaderComponent extends Component {
|
||||
static getId() {
|
||||
return "BeltReader";
|
||||
}
|
||||
|
||||
duplicateWithoutContents() {
|
||||
return new BeltReaderComponent();
|
||||
}
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
/**
|
||||
* Which items went through the reader, we only store the time
|
||||
* @type {Array<number>}
|
||||
*/
|
||||
this.lastItemTimes = [];
|
||||
|
||||
/**
|
||||
* Which item passed the reader last
|
||||
* @type {BaseItem}
|
||||
*/
|
||||
this.lastItem = null;
|
||||
|
||||
/**
|
||||
* Stores the last throughput we computed
|
||||
* @type {number}
|
||||
*/
|
||||
this.lastThroughput = 0;
|
||||
|
||||
/**
|
||||
* Stores when we last computed the throughput
|
||||
* @type {number}
|
||||
*/
|
||||
this.lastThroughputComputation = 0;
|
||||
}
|
||||
}
|
||||
@@ -20,6 +20,7 @@ export const enumItemProcessorTypes = {
|
||||
painterQuad: "painterQuad",
|
||||
hub: "hub",
|
||||
filter: "filter",
|
||||
reader: "reader",
|
||||
};
|
||||
|
||||
/** @enum {string} */
|
||||
|
||||
Reference in New Issue
Block a user