1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2025-06-13 13:04:03 +00:00

Changes to allow more flexibility

This commit is contained in:
Exund 2020-09-08 19:32:33 +02:00
parent f0cf3a2fda
commit 96c5915660
5 changed files with 10 additions and 10 deletions

View File

@ -19,7 +19,7 @@ import { Vector } from "../core/vector";
/**
* Stores a lookup table for all building variants (for better performance)
* @type {Object<number, BuildingVariantIdentifier>}
* @type {Object<string | number, BuildingVariantIdentifier>}
*/
export const gBuildingVariants = {
// Set later
@ -27,7 +27,7 @@ export const gBuildingVariants = {
/**
* Registers a new variant
* @param {number} id
* @param {number | string} id
* @param {typeof MetaBuilding} meta
* @param {string} variant
* @param {number} rotationVariant
@ -50,7 +50,7 @@ export function registerBuildingVariant(
/**
*
* @param {number} code
* @param {number | string} code
* @returns {BuildingVariantIdentifier}
*/
export function getBuildingDataFromCode(code) {
@ -72,7 +72,7 @@ export function getCodeFromBuildingData(metaBuilding, variant, rotationVariant)
data.variant === variant &&
data.rotationVariant === rotationVariant
) {
return +key;
return key;
}
}
assertAlways(

View File

@ -44,7 +44,7 @@ export function initComponentRegistry() {
assert(
// @ts-ignore
require.context("./components", false, /.*\.js/i).keys().length ===
require.context("./components", false, /.*\.js/i).keys().length >=
gComponentRegistry.getNumEntries(),
"Not all components are registered"
);

View File

@ -79,7 +79,7 @@ export class StaticMapEntityComponent extends Component {
* @param {Vector=} param0.tileSize Size of the entity in tiles
* @param {number=} param0.rotation Rotation in degrees. Must be multiple of 90
* @param {number=} param0.originalRotation Original Rotation in degrees. Must be multiple of 90
* @param {number=} param0.code Building code
* @param {(number | string)=} param0.code Building code
*/
constructor({
origin = new Vector(),

View File

@ -238,8 +238,8 @@ export class ItemProcessorSystem extends GameSystemWithFilter {
const items = processorComp.inputSlots;
processorComp.inputSlots = [];
/** @type {Object.<string, { item: BaseItem, sourceSlot: number }>} */
const itemsBySlot = {};
/** @type {Array<{ item: BaseItem, sourceSlot: number }>} */
const itemsBySlot = [];
for (let i = 0; i < items.length; ++i) {
itemsBySlot[items[i].sourceSlot] = items[i];
}

View File

@ -75,7 +75,7 @@ export class MainMenuState extends GameState {
<div class="logo">
<img src="${cachebust("res/logo.png")}" alt="shapez.io Logo">
<span class="updateLabel">Wires update!</span>
<span class="updateLabel">GeoZ!</span>
</div>
@ -119,7 +119,7 @@ export class MainMenuState extends GameState {
<div class="author">${T.mainMenu.madeBy.replace(
"<author-link>",
'<a class="producerLink" target="_blank">Tobias Springer</a>'
'<a class="producerLink" target="_blank">Tobias Springer & modded by Exund</a>'
)}</div>
</div>