Skip to content

Commit

Permalink
Remove MinEdgeDistance (#1661)
Browse files Browse the repository at this point in the history
  • Loading branch information
koosemose authored and bjubes committed Dec 8, 2016
1 parent f346db6 commit a45d663
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 33 deletions.
9 changes: 0 additions & 9 deletions Assets/Scripts/Models/Area/WorldGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ public void Generate(World world, int seed)
int depth = world.Depth;
int offsetX = Random.Range(0, 10000);
int offsetY = Random.Range(0, 10000);

int minEdgeDistance = 5;

int sumOfAllWeightedChances = asteroidInfo.Resources.Select(x => x.WeightedChance).Sum();

Expand Down Expand Up @@ -103,13 +101,6 @@ public void Generate(World world, int seed)
{
Tile tile = world.GetTileAt(x, y, z);

if (tile.X < minEdgeDistance || tile.Y < minEdgeDistance ||
World.Current.Width - tile.X <= minEdgeDistance ||
World.Current.Height - tile.Y <= minEdgeDistance)
{
continue;
}

tile.SetTileType(asteroidFloorType);

world.FurnitureManager.PlaceFurniture("astro_wall", tile, false);
Expand Down
12 changes: 0 additions & 12 deletions Assets/Scripts/Models/Buildable/Furniture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@
public class Furniture : ISelectable, IPrototypable, IContextActionProvider, IBuildable
{
#region Private Variables
// Prevent construction too close to the world's edge
private const int MinEdgeDistance = 5;

private string isEnterableAction;

/// <summary>
Expand Down Expand Up @@ -1218,15 +1215,6 @@ public Furniture Clone()
/// <returns>True if the tile is valid for the placement of the furniture.</returns>
public bool IsValidPosition(Tile tile)
{
bool tooCloseToEdge = tile.X < MinEdgeDistance || tile.Y < MinEdgeDistance ||
World.Current.Width - tile.X <= MinEdgeDistance ||
World.Current.Height - tile.Y <= MinEdgeDistance;

if (tooCloseToEdge)
{
return false;
}

if (HasTypeTag("OutdoorOnly"))
{
if (tile.Room == null || !tile.Room.IsOutsideRoom())
Expand Down
12 changes: 0 additions & 12 deletions Assets/Scripts/Models/Buildable/Utility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@
[MoonSharpUserData]
public class Utility : ISelectable, IPrototypable, IContextActionProvider, IBuildable
{
// Prevent construction too close to the world's edge
private const int MinEdgeDistance = 5;

private bool gridUpdatedThisFrame = false;

/// <summary>
Expand Down Expand Up @@ -645,15 +642,6 @@ public Utility Clone()
/// <returns>True if the tile is valid for the placement of the utility.</returns>
public bool IsValidPosition(Tile tile)
{
bool tooCloseToEdge = tile.X < MinEdgeDistance || tile.Y < MinEdgeDistance ||
World.Current.Width - tile.X <= MinEdgeDistance ||
World.Current.Height - tile.Y <= MinEdgeDistance;

if (tooCloseToEdge)
{
return false;
}

if (HasTypeTag("OutdoorOnly"))
{
if (tile.Room == null || !tile.Room.IsOutsideRoom())
Expand Down

0 comments on commit a45d663

Please sign in to comment.