WAREHOUSE etc

This commit is contained in:
funkyfranky
2018-08-09 00:56:25 +02:00
parent 009e38b6f7
commit 498ec4f86b
5 changed files with 133 additions and 19 deletions

View File

@@ -1205,13 +1205,18 @@ do -- COORDINATE
return self:GetClosestParkingSpot(airbase, terminaltype, false)
end
--- Gets the nearest coordinate to a road.
--- Gets the nearest coordinate to a road (or railroad).
-- @param #COORDINATE self
-- @param #boolean Railroad (Optional) If true, closest point to railroad is returned rather than closest point to conventional road. Default false.
-- @return #COORDINATE Coordinate of the nearest road.
function COORDINATE:GetClosestPointToRoad()
local x,y = land.getClosestPointOnRoads("roads", self.x, self.z)
local vec2={ x = x, y = y }
return COORDINATE:NewFromVec2(vec2)
function COORDINATE:GetClosestPointToRoad(Railroad)
local roadtype="roads"
if Railroad==true then
roadtype="railroads"
end
local x,y = land.getClosestPointOnRoads(roadtype, self.x, self.z)
local vec2={ x = x, y = y }
return COORDINATE:NewFromVec2(vec2)
end

View File

@@ -4735,10 +4735,20 @@ function SET_ZONE:New()
return self
end
--- Add ZONE to SET_ZONE.
-- @param Core.Set#SET_ZONE self
-- @param Core.Zone#ZONE Zone Zone to add to the set.
-- @return #SET_ZONE self
function SET_ZONE:AddZone(Zone)
self:Add(Zone:GetName(), Zone)
return self
end
--- Add ZONEs to SET_ZONE.
-- @param Core.Set#SET_ZONE self
-- @param #string AddZoneNames A single name or an array of ZONE_BASE names.
-- @return self
-- @return #SET_ZONE self
function SET_ZONE:AddZonesByName( AddZoneNames )
local AddZoneNamesArray = ( type( AddZoneNames ) == "table" ) and AddZoneNames or { AddZoneNames }
@@ -4753,7 +4763,7 @@ end
--- Remove ZONEs from SET_ZONE.
-- @param Core.Set#SET_ZONE self
-- @param Core.Zone#ZONE_BASE RemoveZoneNames A single name or an array of ZONE_BASE names.
-- @return self
-- @return #SET_ZONE self
function SET_ZONE:RemoveZonesByName( RemoveZoneNames )
local RemoveZoneNamesArray = ( type( RemoveZoneNames ) == "table" ) and RemoveZoneNames or { RemoveZoneNames }
@@ -4779,8 +4789,7 @@ end
--- Get a random zone from the set.
-- @param #SET_ZONE self
-- @return Core.Zone#ZONE_BASE The random Zone.
-- @return #nil if no zone in the collection.
-- @return Core.Zone#ZONE_BASE The random Zone or #nil if no zone in the collection.
function SET_ZONE:GetRandomZone()
if self:Count() ~= 0 then
@@ -4806,6 +4815,7 @@ end
--- Set a zone probability.
-- @param #SET_ZONE self
-- @param #string ZoneName The name of the zone.
-- @param #number ZoneProbability A value between 0 and 1. 0 = 0% and 1 = 100% probability.
function SET_ZONE:SetZoneProbability( ZoneName, ZoneProbability )
local Zone = self:FindZone( ZoneName )
Zone:SetZoneProbability( ZoneProbability )

View File

@@ -317,7 +317,8 @@ end
--- Set the randomization probability of a zone to be selected.
-- @param #ZONE_BASE self
-- @param ZoneProbability A value between 0 and 1. 0 = 0% and 1 = 100% probability.
-- @param #number ZoneProbability A value between 0 and 1. 0 = 0% and 1 = 100% probability.
-- @return #ZONE_BASE self
function ZONE_BASE:SetZoneProbability( ZoneProbability )
self:F( { self:GetName(), ZoneProbability = ZoneProbability } )