|
|
|
import { enumDirection, Vector } from "../../core/vector";
|
|
|
|
import { ItemAcceptorComponent } from "../components/item_acceptor";
|
|
|
|
import { enumItemProcessorTypes, ItemProcessorComponent } from "../components/item_processor";
|
|
|
|
import { Entity } from "../entity";
|
|
|
|
import { MetaBuilding } from "../meta_building";
|
|
|
|
import { GameRoot } from "../root";
|
|
|
|
import { enumHubGoalRewards } from "../tutorial_goals";
|
|
|
|
|
|
|
|
export class MetaTrashBuilding extends MetaBuilding {
|
|
|
|
constructor() {
|
|
|
|
super("trash");
|
|
|
|
}
|
|
|
|
|
|
|
|
getIsRotateable() {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
getSilhouetteColor() {
|
|
|
|
return "#cd7d86";
|
|
|
|
}
|
|
|
|
|
|
|
|
getDimensions() {
|
|
|
|
return new Vector(1, 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @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 ItemAcceptorComponent({
|
|
|
|
slots: [
|
|
|
|
{
|
|
|
|
pos: new Vector(0, 0),
|
|
|
|
directions: [
|
|
|
|
enumDirection.top,
|
|
|
|
enumDirection.right,
|
|
|
|
enumDirection.bottom,
|
|
|
|
enumDirection.left,
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})
|
|
|
|
);
|
|
|
|
entity.addComponent(
|
|
|
|
new ItemProcessorComponent({
|
|
|
|
inputsPerCharge: 1,
|
|
|
|
processorType: enumItemProcessorTypes.trash,
|
|
|
|
})
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|