1
0
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:
tobspr
2020-08-29 10:38:23 +02:00
parent bb739c80fa
commit 06e276f021
28 changed files with 1397 additions and 1069 deletions

View 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;
}
}

View File

@@ -20,6 +20,7 @@ export const enumItemProcessorTypes = {
painterQuad: "painterQuad",
hub: "hub",
filter: "filter",
reader: "reader",
};
/** @enum {string} */