1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-02-03 13:12:11 +02:00

68 lines
1.3 KiB
Lua
Raw Normal View History

2020-07-30 17:47:50 +02:00
local Global = require 'utils.global'
local this = {}
Global.register(
this,
function(tbl)
this = tbl
end
)
local Public = {}
function Public.reset()
if this.surfaces then
for k, surface in pairs(this.surfaces) do
if surface and surface.valid then
game.delete_surface(surface)
end
end
end
for k, _ in pairs(this) do
this[k] = nil
end
2020-08-09 20:31:50 +02:00
this.debug_mode = true
this.restore_on_theft = false
2020-07-30 17:47:50 +02:00
this.doors = {}
this.cars = {}
2020-08-05 21:36:20 +02:00
this.saved_surfaces = {}
2020-08-09 20:31:50 +02:00
this.allowed_surface = 'nauvis'
2020-07-30 17:47:50 +02:00
this.players = {}
this.surfaces = {}
2020-08-10 23:15:29 +02:00
this.infinity_scrap_enabled = true
2020-07-30 17:47:50 +02:00
this.entity_type = {
['car'] = true,
['tank'] = true
}
this.car_areas = {
['car'] = {left_top = {x = -20, y = 0}, right_bottom = {x = 20, y = 20}},
2020-08-05 21:36:20 +02:00
['tank'] = {left_top = {x = -30, y = 0}, right_bottom = {x = 30, y = 40}}
2020-07-30 17:47:50 +02:00
}
end
function Public.get(key)
if key then
return this[key]
else
return this
end
end
function Public.set_car_area(tbl)
if not tbl then
return
end
this.car_areas = tbl
end
2020-08-09 20:31:50 +02:00
function Public.allowed_surface(value)
if value then
this.allowed_surface = value
end
return this.allowed_surface
end
2020-07-30 17:47:50 +02:00
return Public