-------------------------------------------------------------------
OilRigCreator = function()
	if OilRigcount == OilRigMaxcount and OilRigCreatorState then
		Trigger.AfterDelay(1, function() 
			OilRigCreatorState = false
			Trigger.AfterDelay(1, function()
				OilRigs = mines.GetActorsByType("oilrig.fix")
				Utils.Do(OilRigs, function(r)
				end)
			end)
		end)
	elseif OilRigcount < OilRigMaxcount and OilRigCreatorState then
		CreateOilRig()
	end
end
-------------------------------------------------------------------
CreateOilRig = function()
	local OilRig = Actor.Create("oilrig" .. ".fix", true, { Owner = mines, Location = CPos.New(Utils.RandomInteger(MapSlippedEdgeStartHorizontical + 6, MapSlippedEdgeOverHorizontical - 6), Utils.RandomInteger(MapSlippedEdgeStartVertical + 6, MapSlippedEdgeOverVertical - 6)) })
	OilRigcount = OilRigcount + 1
	Trigger.OnRemovedFromWorld(OilRig, function()
		OilRigcount = OilRigcount - 1
		if OilRigcount < OilRigMaxcount and OilRigCreatorState then OilRigCreator() end
	end)
	if OilRigcount < OilRigMaxcount and OilRigCreatorState then OilRigCreator() end
end
-------------------------------------------------------------------
OilWellsModifier = function()
	Trigger.AfterDelay(1, function()
	end)
end
-------------------------------------------------------------------
OilWellCreator = function()
	if OilWellcount == OilWellMaxcount and OreMineCreatorState then
		Trigger.AfterDelay(1, function()
			OilWellCreatorState = false
			Trigger.AfterDelay(1, function()
				OilWellsModifier()
			end)
		end)
	elseif OilWellcount < OilWellMaxcount and OreMineCreatorState then
		CreateOilWell()
	end
end
-------------------------------------------------------------------
CreateOilWell = function()
	local OilWell = Actor.Create("v19" .. ".fix", true, { Owner = mines, Location = CPos.New(Utils.RandomInteger(MapSlippedEdgeStartHorizontical + 4, MapSlippedEdgeOverHorizontical - 4), Utils.RandomInteger(MapSlippedEdgeStartVertical + 4, MapSlippedEdgeOverVertical - 4)) })
	OilWellcount = OilWellcount + 1
	Trigger.OnRemovedFromWorld(OilWell, function()
		OilWellcount = OilWellcount - 1
		if OilWellcount < OilWellMaxcount and OilWellCreatorState then OilWellCreator() end
	end)
	if OilWellcount < OilWellMaxcount and OilWellCreatorState then OilWellCreator() end
end
-------------------------------------------------------------------
BigOreMinesModifier = function()
	Trigger.AfterDelay(1, function()
	end)
end
-------------------------------------------------------------------
BigOreMineCreator = function()
	if BigOreMinecount == BigOreMineMaxcount and BigOreMineCreatorState then
		Trigger.AfterDelay(1, function()
			BigOreMineCreatorState = false
			Trigger.AfterDelay(1, function()
				BigOreMinesModifier()
			end)
		end)
	elseif BigOreMinecount < BigOreMineMaxcount and BigOreMineCreatorState then
		BigCreateOreMine()
	end
end
-------------------------------------------------------------------
BigCreateOreMine = function()
	local BigOreMine = Actor.Create("bigoremine" .. ".fix", true, { Owner = mines, Location = CPos.New(Utils.RandomInteger(MapSlippedEdgeStartHorizontical + 6, MapSlippedEdgeOverHorizontical - 6), Utils.RandomInteger(MapSlippedEdgeStartVertical + 6, MapSlippedEdgeOverVertical - 6)) })
	BigOreMinecount = BigOreMinecount + 1
	Trigger.OnRemovedFromWorld(BigOreMine, function()
		BigOreMinecount = BigOreMinecount - 1
		if BigOreMinecount < BigOreMineMaxcount and BigOreMineCreatorState then BigOreMineCreator() end
	end)
	if BigOreMinecount < BigOreMineMaxcount and BigOreMineCreatorState then BigOreMineCreator() end
end
-------------------------------------------------------------------
OreMinesModifier = function()
	Trigger.AfterDelay(1, function()
	end)
end
-------------------------------------------------------------------
OreMineCreator = function()
	if OreMinecount == OreMineMaxcount and OreMineCreatorState then
		Trigger.AfterDelay(1, function()
			OreMineCreatorState = false
			Trigger.AfterDelay(1, function()
				OreMinesModifier()
			end)
		end)
	elseif OreMinecount < OreMineMaxcount and OreMineCreatorState then
		CreateOreMine()
	end
end
-------------------------------------------------------------------
CreateOreMine = function()
	local OreMine = Actor.Create("mine" .. ".fix", true, { Owner = mines, Location = CPos.New(Utils.RandomInteger(MapSlippedEdgeStartHorizontical + 4, MapSlippedEdgeOverHorizontical - 4), Utils.RandomInteger(MapSlippedEdgeStartVertical + 4, MapSlippedEdgeOverVertical - 4)) })
	OreMinecount = OreMinecount + 1
	Trigger.OnRemovedFromWorld(OreMine, function()
		OreMinecount = OreMinecount - 1
		if OreMinecount < OreMineMaxcount and OreMineCreatorState then OreMineCreator() end
	end)
	if OreMinecount < OreMineMaxcount and OreMineCreatorState then OreMineCreator() end
end

