From 59e7095470502627e38b9d038148bd372e78f4d1 Mon Sep 17 00:00:00 2001 From: Sage Vaillancourt Date: Wed, 19 Mar 2025 15:05:35 -0400 Subject: [PATCH] De-global Tiny -> tiny Still depends on a single global World, however. --- main.lua | 4 ++-- tiny-tools.lua | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/main.lua b/main.lua index 5a9a346..3b469f4 100644 --- a/main.lua +++ b/main.lua @@ -1,9 +1,9 @@ require("tiny-debug") -Tiny = require("lib/tiny") require("utils") require("tiny-tools") -World = Tiny.world() +local tiny = require("lib/tiny") +World = tiny.world() require("generated/filter-types") require("generated/assets") diff --git a/tiny-tools.lua b/tiny-tools.lua index 2ff6497..df8c85c 100644 --- a/tiny-tools.lua +++ b/tiny-tools.lua @@ -1,3 +1,5 @@ +local tiny = require("lib/tiny") + ---@generic T ---@param shape T | fun() ---@param process fun(entity: T, dt: number, system: System) | nil @@ -8,7 +10,7 @@ function filteredSystem(name, shape, process, compare) assert(type(shape) == "table" or type(shape) == "function") assert(process == nil or type(process) == "function") - local system = compare and Tiny.sortedProcessingSystem() or Tiny.processingSystem() + local system = compare and tiny.sortedProcessingSystem() or tiny.processingSystem() system.compare = compare system.name = name if type(shape) == "table" then @@ -22,7 +24,7 @@ function filteredSystem(name, shape, process, compare) keys[#keys + 1] = key end end - system.filter = Tiny.requireAll(unpack(keys)) + system.filter = tiny.requireAll(unpack(keys)) elseif type(shape) == "function" then system.filter = shape end