1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2025-06-13 13:04:03 +00:00

Added sideways tunnels

The images could probably stand to be redone. I'm very much not an artist.
This commit is contained in:
Squornshellous Beta 2020-08-04 17:27:16 +01:00
parent 4de30ce075
commit 62230374b8

View File

@ -29,6 +29,16 @@ export const enumUndergroundBeltVariantToTier = {
[enumUndergroundBeltVariants.tier2SideMirrored]: 1, [enumUndergroundBeltVariants.tier2SideMirrored]: 1,
}; };
//This might want to be looked at. I don't understand the whole enum thing well enough to make this return them, nor indeed whether that would be the appropriate course of action.
export const enumUndergroundBeltVariantToDirection = {
[defaultBuildingVariant]: "straight",
[enumUndergroundBeltVariants.side]: "left",
[enumUndergroundBeltVariants.sideMirrored]: "right",
[enumUndergroundBeltVariants.tier2]: "straight",
[enumUndergroundBeltVariants.tier2Side]: "left",
[enumUndergroundBeltVariants.tier2SideMirrored]: "right",
};
export class MetaUndergroundBeltBuilding extends MetaBuilding { export class MetaUndergroundBeltBuilding extends MetaBuilding {
constructor() { constructor() {
super("underground_belt"); super("underground_belt");
@ -221,28 +231,69 @@ export class MetaUndergroundBeltBuilding extends MetaBuilding {
*/ */
updateVariants(entity, rotationVariant, variant) { updateVariants(entity, rotationVariant, variant) {
entity.components.UndergroundBelt.tier = enumUndergroundBeltVariantToTier[variant]; entity.components.UndergroundBelt.tier = enumUndergroundBeltVariantToTier[variant];
entity.components.UndergroundBelt.direction = enumUndergroundBeltVariantToDirection[variant];
switch (arrayUndergroundRotationVariantToMode[rotationVariant]) { switch (arrayUndergroundRotationVariantToMode[rotationVariant]) {
case enumUndergroundBeltMode.sender: { case enumUndergroundBeltMode.sender: {
entity.components.UndergroundBelt.mode = enumUndergroundBeltMode.sender; entity.components.UndergroundBelt.mode = enumUndergroundBeltMode.sender;
entity.components.ItemEjector.setSlots([]); entity.components.ItemEjector.setSlots([]);
entity.components.ItemAcceptor.setSlots([ switch (enumUndergroundBeltVariantToDirection[variant]) {
{ case "straight": {
pos: new Vector(0, 0), entity.components.ItemAcceptor.setSlots([
directions: [(variant=="side"||variant=="tier2-side"?enumDirection.left:(variant=="side-mirrored"||variant=="tier2-side-mirrored"?enumDirection.right:enumDirection.bottom))], {
}, pos: new Vector(0, 0),
]); directions: [enumDirection.bottom],
},
]);
}
case "left": {
entity.components.ItemAcceptor.setSlots([
{
pos: new Vector(0, 0),
directions: [enumDirection.left],
},
]);
}
case "right": {
entity.components.ItemAcceptor.setSlots([
{
pos: new Vector(0, 0),
directions: [enumDirection.right],
},
]);
}
}
return; return;
} }
case enumUndergroundBeltMode.receiver: { case enumUndergroundBeltMode.receiver: {
entity.components.UndergroundBelt.mode = enumUndergroundBeltMode.receiver; entity.components.UndergroundBelt.mode = enumUndergroundBeltMode.receiver;
entity.components.ItemAcceptor.setSlots([]); entity.components.ItemAcceptor.setSlots([]);
entity.components.ItemEjector.setSlots([ switch (enumUndergroundBeltVariantToDirection[variant]) {
{ case "straight": {
pos: new Vector(0, 0), entity.components.ItemEjector.setSlots([
direction: (variant=="side"||variant=="tier2-side"?enumDirection.left:(variant=="side-mirrored"||variant=="tier2-side-mirrored"?enumDirection.right:enumDirection.top)), {
}, pos: new Vector(0, 0),
]); directions: [enumDirection.bottom],
},
]);
}
case "left": {
entity.components.ItemEjector.setSlots([
{
pos: new Vector(0, 0),
directions: [enumDirection.left],
},
]);
}
case "right": {
entity.components.ItemEjector.setSlots([
{
pos: new Vector(0, 0),
directions: [enumDirection.right],
},
]);
}
}
return; return;
} }
default: default: