Skip to content

Commit

Permalink
feat: final version of this branch, everything works after merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Barsol6 committed Jan 6, 2025
1 parent 348c225 commit 8a127f0
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 63 deletions.
3 changes: 3 additions & 0 deletions Server/Modules/MapGenerator/Models/Node.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ public class Node : IPathfindingNode
[Required]
public Biome Biome { get; set; }

[Required]
public TerrainType TerrainType { get; set; }

[Required]
public float NoiseValue { get; set; }

Expand Down
51 changes: 0 additions & 51 deletions Server/Modules/MapGenerator/Services/BiomeFactory.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ private MapData GenerateMap(MapParameters mapParameters)
is TerrainType.DeepOcean
or TerrainType.ShallowWater
),
TerrainType = biomeCategory!.TerrainType,
};
}

Expand Down
13 changes: 9 additions & 4 deletions Server/Modules/MapGenerator/UI/MapView.razor
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@using System.Drawing
@using Fracture.Server.Components.Pages
@using Fracture.Server.Modules.MapGenerator.Models
@using Fracture.Server.Modules.MapGenerator.UI.Models
@using Fracture.Server.Modules.Pathfinding.Models
Expand Down Expand Up @@ -188,10 +189,14 @@

private bool CanMoveToTile(int x, int y)
{
Node targetNode = Map.Grid[x, y];
string tileColor = GetTileColor(targetNode);

return !_blockingColors.Contains(tileColor);
if (Map.Grid[x,y].Walkable==true)
{
return true;
}
else
{
return false;
}
}


Expand Down
16 changes: 8 additions & 8 deletions Server/Modules/Shared/ImageChangers/BacgroundImageChanger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,42 +16,42 @@ public class BacgroundImageChanger
public Task changeBgImgAsync()
{
Console.WriteLine(MapView.CharacterXX);
var biome = Map.Grid[MapView.CharacterXX, MapView.CharacterYY].Biome.BiomeType;
var biome = Map.Grid[MapView.CharacterXX, MapView.CharacterYY].TerrainType;
Console.WriteLine(biome);
switch (biome)
{
case BiomeType.Forest:
case TerrainType.Forest:
{
_bacgroundImage.bgImg = "../assets/background/river.jpg";
Console.WriteLine(_bacgroundImage.bgImg);
break;
}
case BiomeType.Grassland:
case TerrainType.Grassland:
{
_bacgroundImage.bgImg = "../assets/background/river.jpg";
break;
}
case BiomeType.Mountains:
case TerrainType.Mountains:
{
_bacgroundImage.bgImg = "../assets/background/mountains.jpg";
break;
}
case BiomeType.Beach:
case TerrainType.Beach:
{
_bacgroundImage.bgImg = "../assets/background/lava.jpg";
break;
}
case BiomeType.HighMountains:
case TerrainType.HighMountains:
{
_bacgroundImage.bgImg = "../assets/background/mountainsRiver.jpg";
break;
}
case BiomeType.DeepOcean:
case TerrainType.DeepOcean:
{
_bacgroundImage.bgImg = "../assets/background/mountainsRiver.jpg";
break;
}
case BiomeType.ShallowWater:
case TerrainType.ShallowWater:
{
_bacgroundImage.bgImg = "../assets/background/mountainsRiver.jpg";
break;
Expand Down

0 comments on commit 8a127f0

Please sign in to comment.