Refractoring

This commit is contained in:
2015-06-17 14:06:54 +03:00
parent 670f260a4c
commit 6b008cfa9a
38 changed files with 706 additions and 419 deletions

View File

@ -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;
}

View File

@ -4,6 +4,7 @@ using System.Linq;
using System.Text;
using TransportGame.Model;
using TransportGame.Noise;
using TransportGame.Primitives;
namespace TransportGame.Generator
{

View File

@ -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)
{

View File

@ -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;