After Width: | Height: | Size: 8.4 KiB |
After Width: | Height: | Size: 7.1 KiB |
Before Width: | Height: | Size: 61 KiB After Width: | Height: | Size: 66 KiB |
Before Width: | Height: | Size: 1.0 MiB After Width: | Height: | Size: 1.1 MiB |
Before Width: | Height: | Size: 204 KiB After Width: | Height: | Size: 213 KiB |
Before Width: | Height: | Size: 485 KiB After Width: | Height: | Size: 499 KiB |
Before Width: | Height: | Size: 962 KiB After Width: | Height: | Size: 1001 KiB |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 8.4 KiB |
After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 660 B After Width: | Height: | Size: 1005 B |
Before Width: | Height: | Size: 554 B After Width: | Height: | Size: 922 B |
Before Width: | Height: | Size: 516 B After Width: | Height: | Size: 747 B |
Before Width: | Height: | Size: 421 B After Width: | Height: | Size: 458 B |
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 7.3 KiB |
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 42 KiB |
After Width: | Height: | Size: 7.9 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 9.9 KiB |
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 6.0 KiB After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 13 KiB |
@ -0,0 +1,59 @@
|
|||||||
|
import { enumDirection, Vector } from "../../core/vector";
|
||||||
|
import { enumPinSlotType, WiredPinsComponent } from "../components/wired_pins";
|
||||||
|
import { Entity } from "../entity";
|
||||||
|
import { MetaBuilding } from "../meta_building";
|
||||||
|
import { enumLayer, GameRoot } from "../root";
|
||||||
|
|
||||||
|
export class MetaLogicGateBuilding extends MetaBuilding {
|
||||||
|
constructor() {
|
||||||
|
super("logic_gate");
|
||||||
|
}
|
||||||
|
|
||||||
|
getSilhouetteColor() {
|
||||||
|
return "#89dc60";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {GameRoot} root
|
||||||
|
*/
|
||||||
|
getIsUnlocked(root) {
|
||||||
|
// @todo
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
getLayer() {
|
||||||
|
return enumLayer.wires;
|
||||||
|
}
|
||||||
|
|
||||||
|
getDimensions() {
|
||||||
|
return new Vector(1, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates the entity at the given location
|
||||||
|
* @param {Entity} entity
|
||||||
|
*/
|
||||||
|
setupEntityComponents(entity) {
|
||||||
|
entity.addComponent(
|
||||||
|
new WiredPinsComponent({
|
||||||
|
slots: [
|
||||||
|
{
|
||||||
|
pos: new Vector(0, 0),
|
||||||
|
direction: enumDirection.top,
|
||||||
|
type: enumPinSlotType.logicalEjector,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
pos: new Vector(0, 0),
|
||||||
|
direction: enumDirection.left,
|
||||||
|
type: enumPinSlotType.logicalAcceptor,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
pos: new Vector(0, 0),
|
||||||
|
direction: enumDirection.right,
|
||||||
|
type: enumPinSlotType.logicalAcceptor,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|