1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2024-10-27 20:34:29 +00:00

Get rid of some todos / fixmes

This commit is contained in:
tobspr 2020-10-08 19:47:27 +02:00
parent 1025bede1f
commit 8260edb373
13 changed files with 496 additions and 539 deletions

View File

@ -71,10 +71,6 @@ releaseUploader.gulptasksReleaseUploader($, gulp, buildFolder);
const translations = require("./translations"); const translations = require("./translations");
translations.gulptasksTranslations($, gulp, buildFolder); translations.gulptasksTranslations($, gulp, buildFolder);
// FIXME
// const cordova = require("./cordova");
// cordova.gulptasksCordova($, gulp, buildFolder);
///////////////////// BUILD TASKS ///////////////////// ///////////////////// BUILD TASKS /////////////////////
// Cleans up everything // Cleans up everything

View File

@ -146,8 +146,6 @@ export class ClickDetector {
this.touchend.removeAll(); this.touchend.removeAll();
this.touchcancel.removeAll(); this.touchcancel.removeAll();
// TODO: Remove pointer captures
this.element = null; this.element = null;
} }
} }

View File

@ -19,7 +19,6 @@ export class DrawParameters {
/** @type {number} */ /** @type {number} */
this.zoomLevel = zoomLevel; this.zoomLevel = zoomLevel;
// FIXME: Not really nice
/** @type {GameRoot} */ /** @type {GameRoot} */
this.root = root; this.root = root;
} }

View File

@ -44,7 +44,6 @@ export class RestrictionManager extends ReadWriteProxy {
* @param {any} data * @param {any} data
*/ */
migrate(data) { migrate(data) {
// Todo
return ExplainedResult.good(); return ExplainedResult.good();
} }

View File

@ -41,7 +41,7 @@ const variantsCache = new Map();
export function registerBuildingVariant( export function registerBuildingVariant(
code, code,
meta, meta,
variant = "default" /* FIXME: Circular dependency, actually its defaultBuildingVariant */, variant = "default" /* @TODO: Circular dependency, actually its defaultBuildingVariant */,
rotationVariant = 0 rotationVariant = 0
) { ) {
assert(!gBuildingVariants[code], "Duplicate id: " + code); assert(!gBuildingVariants[code], "Duplicate id: " + code);

View File

@ -191,7 +191,6 @@ export class MetaUndergroundBeltBuilding extends MetaBuilding {
) { ) {
tile = tile.addScalars(searchVector.x, searchVector.y); tile = tile.addScalars(searchVector.x, searchVector.y);
/* WIRES: FIXME */
const contents = root.map.getTileContent(tile, "regular"); const contents = root.map.getTileContent(tile, "regular");
if (contents) { if (contents) {
const undergroundComp = contents.components.UndergroundBelt; const undergroundComp = contents.components.UndergroundBelt;

View File

@ -182,23 +182,6 @@ export class EntityManager extends BasicSerializableObject {
return this.componentToEntity[componentHandle.getId()] || []; return this.componentToEntity[componentHandle.getId()] || [];
} }
/**
* Return all of a given class. This is SLOW!
* @param {object} entityClass
* @returns {Array<Entity>} entities
*/
getAllOfClass(entityClass) {
// FIXME: Slow
const result = [];
for (let i = 0; i < this.entities.length; ++i) {
const entity = this.entities[i];
if (entity instanceof entityClass) {
result.push(entity);
}
}
return result;
}
/** /**
* Unregisters all components of an entity from the component to entity mapping * Unregisters all components of an entity from the component to entity mapping
* @param {Entity} entity * @param {Entity} entity

View File

@ -11,6 +11,7 @@ import { ShapeItem } from "../../items/shape_item";
import { WireComponent } from "../../components/wire"; import { WireComponent } from "../../components/wire";
import { LeverComponent } from "../../components/lever"; import { LeverComponent } from "../../components/lever";
// @todo: Make dictionary
const tutorialsByLevel = [ const tutorialsByLevel = [
// Level 1 // Level 1
[ [

View File

@ -225,8 +225,7 @@ export class ItemEjectorSystem extends GameSystemWithFilter {
*/ */
tryPassOverItem(item, receiver, slotIndex) { tryPassOverItem(item, receiver, slotIndex) {
// Try figuring out how what to do with the item // Try figuring out how what to do with the item
// TODO: Kinda hacky. How to solve this properly? Don't want to go through inheritance hell. // @TODO: Kinda hacky. How to solve this properly? Don't want to go through inheritance hell.
// Also its just a few cases (hope it stays like this .. :x).
const beltComp = receiver.components.Belt; const beltComp = receiver.components.Belt;
if (beltComp) { if (beltComp) {

View File

@ -55,7 +55,7 @@ export const enumHubGoalRewardsToContentUnlocked = {
]), ]),
[enumHubGoalRewards.reward_logic_gates]: typed([[MetaLogicGateBuilding, defaultBuildingVariant]]), [enumHubGoalRewards.reward_logic_gates]: typed([[MetaLogicGateBuilding, defaultBuildingVariant]]),
[enumHubGoalRewards.reward_filter]: typed([[MetaFilterBuilding, defaultBuildingVariant]]), [enumHubGoalRewards.reward_filter]: typed([[MetaFilterBuilding, defaultBuildingVariant]]),
[enumHubGoalRewards.reward_virtual_processing]: null, // @TODO! [enumHubGoalRewards.reward_virtual_processing]: null,
[enumHubGoalRewards.reward_wires_painter_and_levers]: typed([ [enumHubGoalRewards.reward_wires_painter_and_levers]: typed([
[MetaPainterBuilding, enumPainterVariants.quad], [MetaPainterBuilding, enumPainterVariants.quad],

View File

@ -41,7 +41,7 @@ export class SavegameManager extends ReadWriteProxy {
} }
verify(data) { verify(data) {
// TODO / FIXME!!!! // @TODO
return ExplainedResult.good(); return ExplainedResult.good();
} }

View File

@ -21,10 +21,6 @@ export class PreloadState extends GameState {
<div class="loadingImage"></div> <div class="loadingImage"></div>
<div class="loadingStatus"> <div class="loadingStatus">
<span class="desc">Booting</span> <span class="desc">Booting</span>
<span class="bar">
<span class="inner" style="width: 0%"></span>
<span class="status">0%</span>
</span>
</div> </div>
</div> </div>
<span class="prefab_GameHint"></span> <span class="prefab_GameHint"></span>
@ -56,10 +52,6 @@ export class PreloadState extends GameState {
/** @type {HTMLElement} */ /** @type {HTMLElement} */
this.statusText = this.htmlElement.querySelector(".loadingStatus > .desc"); this.statusText = this.htmlElement.querySelector(".loadingStatus > .desc");
/** @type {HTMLElement} */
this.statusBar = this.htmlElement.querySelector(".loadingStatus > .bar > .inner");
/** @type {HTMLElement} */
this.statusBarText = this.htmlElement.querySelector(".loadingStatus > .bar > .status");
/** @type {HTMLElement} */ /** @type {HTMLElement} */
this.hintsText = this.htmlElement.querySelector(".prefab_GameHint"); this.hintsText = this.htmlElement.querySelector(".prefab_GameHint");
@ -67,7 +59,6 @@ export class PreloadState extends GameState {
this.nextHintDuration = 0; this.nextHintDuration = 0;
this.currentStatus = "booting"; this.currentStatus = "booting";
this.currentIndex = 0;
this.startLoading(); this.startLoading();
} }
@ -259,16 +250,8 @@ export class PreloadState extends GameState {
*/ */
setStatus(text) { setStatus(text) {
logger.log("✅ " + text); logger.log("✅ " + text);
this.currentIndex += 1;
this.currentStatus = text; this.currentStatus = text;
this.statusText.innerText = text; this.statusText.innerText = text;
const numSteps = 10; // FIXME
const percentage = (this.currentIndex / numSteps) * 100.0;
this.statusBar.style.width = percentage + "%";
this.statusBarText.innerText = findNiceValue(percentage) + "%";
return Promise.resolve(); return Promise.resolve();
} }

View File

@ -36,7 +36,7 @@ function match(originalObj, translatedObj, path = "/") {
if (typeof valueOriginal === "object") { if (typeof valueOriginal === "object") {
match(valueOriginal, valueMatching, path + key + "/"); match(valueOriginal, valueMatching, path + key + "/");
} else if (typeof valueOriginal === "string") { } else if (typeof valueOriginal === "string") {
// todo // @todo
const originalPlaceholders = matchAll(valueOriginal, placeholderRegexp).toArray(); const originalPlaceholders = matchAll(valueOriginal, placeholderRegexp).toArray();
const translatedPlaceholders = matchAll(valueMatching, placeholderRegexp).toArray(); const translatedPlaceholders = matchAll(valueMatching, placeholderRegexp).toArray();