mirror of
https://github.com/tobspr/shapez.io.git
synced 2025-06-13 13:04:03 +00:00
Change Component that uses Processor that implements tryTakeItem
This commit is contained in:
parent
e1a47905e8
commit
491e8dce23
@ -95,6 +95,7 @@ export class MetaAdvancedProcessorBuilding extends MetaBuilding {
|
||||
pos: new Vector(0, 1),
|
||||
directions: [enumDirection.left],
|
||||
filter: enumItemType.shape,
|
||||
processor: "ItemProcessor",
|
||||
},
|
||||
|
||||
{
|
||||
|
@ -83,6 +83,7 @@ export class MetaCutterBuilding extends MetaBuilding {
|
||||
pos: new Vector(0, 0),
|
||||
directions: [enumDirection.bottom],
|
||||
filter: enumItemType.shape,
|
||||
processor: "ItemProcessor",
|
||||
},
|
||||
],
|
||||
})
|
||||
|
@ -55,11 +55,13 @@ export class MetaEnergyGenerator extends MetaBuilding {
|
||||
pos: new Vector(0, 1),
|
||||
directions: [enumDirection.bottom],
|
||||
filter: enumItemType.shape,
|
||||
processor: "EnergyGenerator",
|
||||
},
|
||||
{
|
||||
pos: new Vector(1, 1),
|
||||
directions: [enumDirection.bottom],
|
||||
filter: enumItemType.shape,
|
||||
processor: "EnergyGenerator",
|
||||
},
|
||||
{
|
||||
pos: new Vector(1, 0),
|
||||
|
@ -52,71 +52,85 @@ export class MetaHubBuilding extends MetaBuilding {
|
||||
pos: new Vector(0, 0),
|
||||
directions: [enumDirection.top, enumDirection.left],
|
||||
filter: enumItemType.shape,
|
||||
processor: "ItemProcessor",
|
||||
},
|
||||
{
|
||||
pos: new Vector(1, 0),
|
||||
directions: [enumDirection.top],
|
||||
filter: enumItemType.shape,
|
||||
processor: "ItemProcessor",
|
||||
},
|
||||
{
|
||||
pos: new Vector(2, 0),
|
||||
directions: [enumDirection.top],
|
||||
filter: enumItemType.shape,
|
||||
processor: "ItemProcessor",
|
||||
},
|
||||
{
|
||||
pos: new Vector(3, 0),
|
||||
directions: [enumDirection.top, enumDirection.right],
|
||||
filter: enumItemType.shape,
|
||||
processor: "ItemProcessor",
|
||||
},
|
||||
{
|
||||
pos: new Vector(0, 3),
|
||||
directions: [enumDirection.bottom, enumDirection.left],
|
||||
filter: enumItemType.shape,
|
||||
processor: "ItemProcessor",
|
||||
},
|
||||
{
|
||||
pos: new Vector(1, 3),
|
||||
directions: [enumDirection.bottom],
|
||||
filter: enumItemType.shape,
|
||||
processor: "ItemProcessor",
|
||||
},
|
||||
{
|
||||
pos: new Vector(2, 3),
|
||||
directions: [enumDirection.bottom],
|
||||
filter: enumItemType.shape,
|
||||
processor: "ItemProcessor",
|
||||
},
|
||||
{
|
||||
pos: new Vector(3, 3),
|
||||
directions: [enumDirection.bottom, enumDirection.right],
|
||||
filter: enumItemType.shape,
|
||||
processor: "ItemProcessor",
|
||||
},
|
||||
{
|
||||
pos: new Vector(0, 1),
|
||||
directions: [enumDirection.left],
|
||||
filter: enumItemType.shape,
|
||||
processor: "ItemProcessor",
|
||||
},
|
||||
{
|
||||
pos: new Vector(0, 2),
|
||||
directions: [enumDirection.left],
|
||||
filter: enumItemType.shape,
|
||||
processor: "ItemProcessor",
|
||||
},
|
||||
{
|
||||
pos: new Vector(0, 3),
|
||||
directions: [enumDirection.left],
|
||||
filter: enumItemType.shape,
|
||||
processor: "ItemProcessor",
|
||||
},
|
||||
{
|
||||
pos: new Vector(3, 1),
|
||||
directions: [enumDirection.right],
|
||||
filter: enumItemType.shape,
|
||||
processor: "ItemProcessor",
|
||||
},
|
||||
{
|
||||
pos: new Vector(3, 2),
|
||||
directions: [enumDirection.right],
|
||||
filter: enumItemType.shape,
|
||||
processor: "ItemProcessor",
|
||||
},
|
||||
{
|
||||
pos: new Vector(3, 3),
|
||||
directions: [enumDirection.right],
|
||||
filter: enumItemType.shape,
|
||||
processor: "ItemProcessor",
|
||||
},
|
||||
],
|
||||
})
|
||||
|
@ -64,11 +64,13 @@ export class MetaMixerBuilding extends MetaBuilding {
|
||||
pos: new Vector(0, 0),
|
||||
directions: [enumDirection.bottom],
|
||||
filter: enumItemType.color,
|
||||
processor: "ItemProcessor",
|
||||
},
|
||||
{
|
||||
pos: new Vector(1, 0),
|
||||
directions: [enumDirection.bottom],
|
||||
filter: enumItemType.color,
|
||||
processor: "ItemProcessor",
|
||||
},
|
||||
],
|
||||
})
|
||||
|
@ -99,11 +99,13 @@ export class MetaPainterBuilding extends MetaBuilding {
|
||||
pos: new Vector(0, 0),
|
||||
directions: [enumDirection.left],
|
||||
filter: enumItemType.shape,
|
||||
processor: "ItemProcessor",
|
||||
},
|
||||
{
|
||||
pos: new Vector(1, 0),
|
||||
directions: [enumDirection.top],
|
||||
filter: enumItemType.color,
|
||||
processor: "ItemProcessor",
|
||||
},
|
||||
],
|
||||
})
|
||||
|
@ -78,6 +78,7 @@ export class MetaRotaterBuilding extends MetaBuilding {
|
||||
pos: new Vector(0, 0),
|
||||
directions: [enumDirection.bottom],
|
||||
filter: enumItemType.shape,
|
||||
processor: "ItemProcessor",
|
||||
},
|
||||
],
|
||||
})
|
||||
|
@ -115,10 +115,12 @@ export class MetaSplitterBuilding extends MetaBuilding {
|
||||
{
|
||||
pos: new Vector(0, 0),
|
||||
directions: [enumDirection.bottom],
|
||||
processor: "ItemProcessor",
|
||||
},
|
||||
{
|
||||
pos: new Vector(1, 0),
|
||||
directions: [enumDirection.bottom],
|
||||
processor: "ItemProcessor",
|
||||
},
|
||||
]);
|
||||
|
||||
@ -140,6 +142,7 @@ export class MetaSplitterBuilding extends MetaBuilding {
|
||||
{
|
||||
pos: new Vector(0, 0),
|
||||
directions: [enumDirection.bottom],
|
||||
processor: "ItemProcessor",
|
||||
},
|
||||
{
|
||||
pos: new Vector(0, 0),
|
||||
@ -148,6 +151,7 @@ export class MetaSplitterBuilding extends MetaBuilding {
|
||||
? enumDirection.left
|
||||
: enumDirection.right,
|
||||
],
|
||||
processor: "ItemProcessor",
|
||||
},
|
||||
]);
|
||||
|
||||
|
@ -64,11 +64,13 @@ export class MetaStackerBuilding extends MetaBuilding {
|
||||
pos: new Vector(0, 0),
|
||||
directions: [enumDirection.bottom],
|
||||
filter: enumItemType.shape,
|
||||
processor: "ItemProcessor",
|
||||
},
|
||||
{
|
||||
pos: new Vector(1, 0),
|
||||
directions: [enumDirection.bottom],
|
||||
filter: enumItemType.shape,
|
||||
processor: "ItemProcessor",
|
||||
},
|
||||
],
|
||||
})
|
||||
|
@ -127,6 +127,7 @@ export class MetaTrashBuilding extends MetaBuilding {
|
||||
enumDirection.bottom,
|
||||
enumDirection.left,
|
||||
],
|
||||
processor: "ItemProcessor",
|
||||
},
|
||||
]);
|
||||
entity.components.ItemEjector.setSlots([]);
|
||||
|
@ -295,19 +295,6 @@ export class ItemEjectorSystem extends GameSystemWithFilter {
|
||||
// Energy consumer can have more components
|
||||
}
|
||||
|
||||
const itemProcessorComp = receiver.components.ItemProcessor;
|
||||
if (itemProcessorComp) {
|
||||
// Make sure its the same layer
|
||||
if (itemLayer === receiver.layer) {
|
||||
// Its an item processor ..
|
||||
if (itemProcessorComp.tryTakeItem(item, slotIndex)) {
|
||||
return true;
|
||||
}
|
||||
// Item processor can have nothing else
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
const undergroundBeltComp = receiver.components.UndergroundBelt;
|
||||
if (undergroundBeltComp) {
|
||||
// Its an underground belt. yay.
|
||||
@ -336,17 +323,6 @@ export class ItemEjectorSystem extends GameSystemWithFilter {
|
||||
return false;
|
||||
}
|
||||
|
||||
const energyGeneratorComp = receiver.components.EnergyGenerator;
|
||||
if (energyGeneratorComp) {
|
||||
if (energyGeneratorComp.tryTakeItem(item, slotIndex)) {
|
||||
// Passed it over
|
||||
return true;
|
||||
}
|
||||
|
||||
// Energy generator comp can't have anything else
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user