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.
66 lines
1.8 KiB
66 lines
1.8 KiB
4 years ago
|
import { enumDirection, Vector } from "../../core/vector";
|
||
|
import { ItemAcceptorComponent } from "../components/item_acceptor";
|
||
|
import { ItemEjectorComponent } from "../components/item_ejector";
|
||
|
import { enumItemProcessorTypes, ItemProcessorComponent } from "../components/item_processor";
|
||
|
import { Entity } from "../entity";
|
||
|
import { MetaBuilding } from "../meta_building";
|
||
|
import { enumHubGoalRewards } from "../tutorial_goals";
|
||
|
import { GameRoot } from "../root";
|
||
|
|
||
|
export class MetaTrashBuilding extends MetaBuilding {
|
||
|
constructor() {
|
||
|
super("trash");
|
||
|
}
|
||
|
|
||
|
isRotateable() {
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
getSilhouetteColor() {
|
||
|
return "#cd7d86";
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* @param {GameRoot} root
|
||
|
*/
|
||
|
getIsUnlocked(root) {
|
||
|
return root.hubGoals.isRewardUnlocked(enumHubGoalRewards.reward_cutter_and_trash);
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Creates the entity at the given location
|
||
|
* @param {Entity} entity
|
||
|
*/
|
||
|
setupEntityComponents(entity) {
|
||
|
entity.addComponent(
|
||
|
new ItemProcessorComponent({
|
||
|
inputsPerCharge: 1,
|
||
|
processorType: enumItemProcessorTypes.trash,
|
||
|
})
|
||
|
);
|
||
|
|
||
|
// Required, since the item processor needs this.
|
||
|
entity.addComponent(
|
||
|
new ItemEjectorComponent({
|
||
|
slots: [],
|
||
|
})
|
||
|
);
|
||
|
|
||
|
entity.addComponent(
|
||
|
new ItemAcceptorComponent({
|
||
|
slots: [
|
||
|
{
|
||
|
pos: new Vector(0, 0),
|
||
|
directions: [
|
||
|
enumDirection.top,
|
||
|
enumDirection.right,
|
||
|
enumDirection.bottom,
|
||
|
enumDirection.left,
|
||
|
],
|
||
|
},
|
||
|
],
|
||
|
})
|
||
|
);
|
||
|
}
|
||
|
}
|