Refractoring
This commit is contained in:
@ -4,6 +4,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using TransportGame.Business;
|
||||
using TransportGame.Model;
|
||||
using TransportGame.Primitives;
|
||||
using TransportGame.Model.Road;
|
||||
using TransportGame.Utils;
|
||||
|
||||
@ -112,7 +113,7 @@ namespace TransportGame.Generator
|
||||
|
||||
foreach (var lot in lotTree.Query(lotArea))
|
||||
{
|
||||
if (BuildingLot.DoesIntersect(lot0, lot))
|
||||
if (Polygon.Intersect(lot0, lot))
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -4,6 +4,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using TransportGame.Model;
|
||||
using TransportGame.Noise;
|
||||
using TransportGame.Primitives;
|
||||
|
||||
namespace TransportGame.Generator
|
||||
{
|
||||
|
@ -5,8 +5,9 @@ using System.Text;
|
||||
using TransportGame.Business;
|
||||
using TransportGame.Model;
|
||||
using TransportGame.Model.Road;
|
||||
using TransportGame.Primitives;
|
||||
using TransportGame.Utils;
|
||||
using Vector2 = TransportGame.Model.Vector2;
|
||||
using Vector2 = TransportGame.Primitives.Vector2;
|
||||
|
||||
namespace TransportGame.Generator
|
||||
{
|
||||
@ -259,8 +260,7 @@ namespace TransportGame.Generator
|
||||
}
|
||||
|
||||
// Filter & sort the segments by distance
|
||||
segmentIds = segmentIds.Distinct().OrderBy(id =>
|
||||
LineSegment.Distance(map.RoadNetwork.ArticulationSegments[id].AsLineSegment(), segment.Terminal2Pos));
|
||||
segmentIds = segmentIds.Distinct().OrderBy(id => map.RoadNetwork.ArticulationSegments[id].AsLineSegment().Distance(segment.Terminal2Pos));
|
||||
|
||||
foreach (var segmentId in segmentIds)
|
||||
{
|
||||
|
@ -47,7 +47,7 @@ namespace TransportGame.Generator
|
||||
GenerateElevation(map);
|
||||
|
||||
// Generate water level
|
||||
float waterAmount = random.NextSingle(map.Biome.Moisture.Minimum, map.Biome.Moisture.Maximum);
|
||||
float waterAmount = random.NextSingle(map.Biome.Moisture.Min, map.Biome.Moisture.Max);
|
||||
map.WaterLevel = Mathf.Pow(waterAmount, ConfigManager.Tergen.WaterNonLinearPower) * map.Biome.Height;
|
||||
|
||||
return map;
|
||||
|
Reference in New Issue
Block a user