mirror of
https://github.com/S4mpsa/InfOS.git
synced 2025-08-04 02:16:05 -04:00
28 lines
557 B
Lua
28 lines
557 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,
|
|
{
|
|
mock = mock,
|
|
name = "Generic Machine"
|
|
}
|
|
)
|
|
local machines = {}
|
|
|
|
function machine.getMachine(address, name)
|
|
if machines[address] then
|
|
return machines[address]
|
|
else
|
|
local mach = machine:new(address, name)
|
|
machines[address] = mach
|
|
return mach
|
|
end
|
|
end
|
|
|
|
return machine
|