1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2026-03-02 03:39:21 +00:00

Minor fixes to the throughput

This commit is contained in:
tobspr
2020-06-27 16:40:51 +02:00
parent 84417b60a5
commit de0b305276
4 changed files with 36 additions and 11 deletions

View File

@@ -1,8 +1,7 @@
import { gItemRegistry } from "../../core/global_registries";
import { types } from "../../savegame/serialization";
import { BaseItem } from "../base_item";
import { Component } from "../component";
import { enumDirection, Vector } from "../../core/vector";
import { types } from "../../savegame/serialization";
import { gItemRegistry } from "../../core/global_registries";
/** @enum {string} */
export const enumItemProcessorTypes = {
@@ -102,6 +101,12 @@ export class ItemProcessorComponent extends Component {
* @param {number} sourceSlot
*/
tryTakeItem(item, sourceSlot) {
if (this.type === enumItemProcessorTypes.hub || this.type === enumItemProcessorTypes.trash) {
// Hub has special logic .. not really nice but efficient.
this.inputSlots.push({ item, sourceSlot });
return true;
}
// Check that we only take one item per slot
for (let i = 0; i < this.inputSlots.length; ++i) {
const slot = this.inputSlots[i];