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

Add CCW rotater

This commit is contained in:
tobspr
2020-05-16 23:13:45 +02:00
parent 12fc7b084a
commit 5179488373
20 changed files with 433 additions and 280 deletions

View File

@@ -175,7 +175,7 @@ export class ItemProcessorSystem extends GameSystemWithFilter {
// ROTATER
case enumItemProcessorTypes.rotater: {
const inputItem = /** @type {ShapeItem} */ (items[0].item);
assert(inputItem instanceof ShapeItem, "Input for cut is not a shape");
assert(inputItem instanceof ShapeItem, "Input for rotation is not a shape");
const inputDefinition = inputItem.definition;
const rotatedDefinition = this.root.shapeDefinitionMgr.shapeActionRotateCW(inputDefinition);
@@ -185,6 +185,19 @@ export class ItemProcessorSystem extends GameSystemWithFilter {
break;
}
// ROTATER ( CCW)
case enumItemProcessorTypes.rotaterCCW: {
const inputItem = /** @type {ShapeItem} */ (items[0].item);
assert(inputItem instanceof ShapeItem, "Input for rotation is not a shape");
const inputDefinition = inputItem.definition;
const rotatedDefinition = this.root.shapeDefinitionMgr.shapeActionRotateCCW(inputDefinition);
outItems.push({
item: new ShapeItem(rotatedDefinition),
});
break;
}
// STACKER
case enumItemProcessorTypes.stacker: {

View File

@@ -3,7 +3,6 @@ import { DrawParameters } from "../../core/draw_parameters";
import { MinerComponent } from "../components/miner";
import { GameSystemWithFilter } from "../game_system_with_filter";
import { MapChunkView } from "../map_chunk_view";
import { ShapeItem } from "../items/shape_item";
import { enumDirectionToVector } from "../../core/vector";
import { Entity } from "../entity";
import { BaseItem } from "../base_item";
@@ -20,7 +19,6 @@ export class MinerSystem extends GameSystemWithFilter {
const minerComp = entity.components.Miner;
const staticComp = entity.components.StaticMapEntity;
const ejectComp = entity.components.ItemEjector;
// First, try to get rid of chained items
if (minerComp.itemChainBuffer.length > 0) {