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.
41 lines
1.3 KiB
41 lines
1.3 KiB
4 years ago
|
import { enumDirection, Vector } from "../../core/vector";
|
||
|
import { ItemEjectorComponent } from "../components/item_ejector";
|
||
|
import { ItemProducerComponent } from "../components/item_producer";
|
||
|
import { enumPinSlotType, WiredPinsComponent } from "../components/wired_pins";
|
||
|
import { Entity } from "../entity";
|
||
|
import { MetaBuilding } from "../meta_building";
|
||
|
|
||
|
export class MetaItemProducerBuilding extends MetaBuilding {
|
||
|
constructor() {
|
||
|
super("item_producer");
|
||
|
}
|
||
|
|
||
|
getSilhouetteColor() {
|
||
|
return "#b37dcd";
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Creates the entity at the given location
|
||
|
* @param {Entity} entity
|
||
|
*/
|
||
|
setupEntityComponents(entity) {
|
||
|
entity.addComponent(
|
||
|
new ItemEjectorComponent({
|
||
|
slots: [{ pos: new Vector(0, 0), direction: enumDirection.top }],
|
||
|
})
|
||
|
);
|
||
|
entity.addComponent(
|
||
|
new WiredPinsComponent({
|
||
|
slots: [
|
||
|
{
|
||
|
pos: new Vector(0, 0),
|
||
|
type: enumPinSlotType.logicalAcceptor,
|
||
|
direction: enumDirection.bottom,
|
||
|
},
|
||
|
],
|
||
|
})
|
||
|
);
|
||
|
entity.addComponent(new ItemProducerComponent());
|
||
|
}
|
||
|
}
|