mirror of
https://github.com/S4mpsa/InfOS.git
synced 2025-08-03 18:06:04 -04:00
31 lines
752 B
Lua
31 lines
752 B
Lua
-- Import section
|
|
local mock = require("data.mock.mock-energy-provider")
|
|
EnergyProvider = require("data.datasource.energy-provider")
|
|
Inherits = require("utils.inherits")
|
|
--
|
|
|
|
local machine = Inherits(EnergyProvider)
|
|
local machines = {}
|
|
machine.types = {
|
|
energy = "energy",
|
|
multiblock = "multiblock",
|
|
singleblock = "singleblock"
|
|
}
|
|
|
|
function machine.getMachine(address, name, type)
|
|
if machines[address] then
|
|
return machines[address]
|
|
else
|
|
local mach = {}
|
|
if type == machine.types.energy then
|
|
print(machine.name)
|
|
elseif type == machine.types.multiblock then
|
|
end
|
|
mach = machine:new(address, name)
|
|
machines[address] = mach
|
|
return mach
|
|
end
|
|
end
|
|
|
|
return machine
|