Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Rod = require("/apis/Reactor.Rod")
- local Battery = require("/apis/Reactor.Battery")
- local CoolantTank = require("/apis/Reactor.CoolantTank")
- local FuelTank = require("/apis/Reactor.FuelTank")
- local Reactor = {
- active = false,
- ambient_temp = 0,
- battery = Battery,
- casing_temp = 0,
- connected = false,
- control_rods = {},
- coolant_tank = CoolantTank,
- fuel_tank = FuelTank,
- fuel_temp = 0,
- stack_temp = 0,
- }
- setmetatable(Reactor, Reactor)
- function Reactor:new(reactor)
- reactor = reactor or {}
- setmetatable(reactor, Reactor)
- Reactor.__index = Reactor
- reactor.battery = Battery:new(reactor.battery)
- reactor.coolant_tank = CoolantTank:new(reactor.coolant_tank)
- reactor.fuel_tank = FuelTank:new(reactor.fuel_tank)
- return {
- active = function()
- return reactor.active
- end,
- ambientTemperature = function()
- return reactor.ambient_temp
- end,
- battery = function()
- return reactor.battery
- end,
- controlRodCount = function()
- return #reactor.control_rods
- end,
- coolantTank = function()
- return reactor.coolant_tank
- end,
- fuelTank = function()
- return reactor.fuel_tank
- end,
- fuelTemperature = function()
- return reactor.fuel_temp
- end,
- getControlRod = function(index)
- return reactor.control_rods[index]
- end,
- setActive = function(active)
- reactor.active = active
- end,
- setAllControlRodLevels = function(level)
- for _, rod in ipairs(reactor.control_rods) do
- rod.setLevel(level)
- end
- end,
- stackTemperature = function()
- return reactor.stack_temp
- end,
- }
- end
- return Reactor
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement