Minor Namming Fixes

This commit is contained in:
2025-07-13 21:46:51 -03:00
parent 2c93b65b3d
commit 6ebf591d64
9 changed files with 8 additions and 12 deletions

View File

@@ -0,0 +1,46 @@
export const getSourceById = (sourceId: string): Source | null => {
if (!sourceId) {
console.log("getSourceById called with an empty or undefined sourceId.");
return null;
}
const source = Game.getObjectById<Source>(sourceId);
if (!source) {
console.log(`No source found with ID: ${sourceId}`);
return null;
}
return source;
}
export const getSpawnById = (spawnId: string): StructureSpawn | null => {
if (!spawnId) {
console.log("getSpawnById called with an empty or undefined spawnId.");
return null;
}
const spawn = Game.getObjectById<StructureSpawn>(spawnId);
if (!spawn) {
console.log(`No spawn found with ID: ${spawnId}`);
return null;
}
return spawn;
}
export const getControllerById = (controllerId: string): StructureController | null => {
if (!controllerId) {
console.log("getControllerById called with an empty or undefined controllerId.");
return null;
}
const controller = Game.getObjectById<StructureController>(controllerId);
if (!controller) {
console.log(`No controller found with ID: ${controllerId}`);
return null;
}
return controller;
}