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.
tobspr_shapez.io/src/js/game/components/belt_underlays.js

42 lines
1005 B

import { enumDirection, Vector } from "../../core/vector";
import { Component } from "../component";
/**
* Store which type an underlay is, this is cached so we can easily
* render it.
*
* Full: Render underlay at top and bottom of tile
* Bottom Only: Only render underlay at the bottom half
* Top Only:
* @enum {string}
*/
export const enumClippedBeltUnderlayType = {
full: "full",
bottomOnly: "bottomOnly",
topOnly: "topOnly",
none: "none",
};
/**
* @typedef {{
* pos: Vector,
* direction: enumDirection,
* cachedType?: enumClippedBeltUnderlayType
* }} BeltUnderlayTile
*/
export class BeltUnderlaysComponent extends Component {
static getId() {
return "BeltUnderlays";
}
/**
* @param {object} param0
* @param {Array<BeltUnderlayTile>=} param0.underlays Where to render belt underlays
*/
constructor({ underlays = [] }) {
super();
this.underlays = underlays;
}
}