You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
60 lines
1.5 KiB
60 lines
1.5 KiB
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,
|
|
},
|
|
],
|
|
})
|
|
);
|
|
}
|
|
}
|