Skip to content

Commit

Permalink
[#2, #3, #6]: refit for [#1]
Browse files Browse the repository at this point in the history
  • Loading branch information
3k-dome committed May 5, 2023
1 parent 2210647 commit 66197d6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
7 changes: 5 additions & 2 deletions catan-lib/Parts/EdgeTile.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using CatanLib.Enums;
using CatanLib.Interfaces;
using CatanLib.Interfaces.Components;
using HexagonLib;

namespace CatanLib.Parts
Expand Down Expand Up @@ -50,7 +50,10 @@ public IEnumerable<string> ToExplainedVector()
return descriptions;
}

public IEnumerable<float> ToVector()
public IEnumerable<float> ToVector<TSettlement, TRoad, TDice>(Catan<TSettlement, TRoad, TDice> catan)
where TSettlement : ISettlement, new()
where TRoad : IRoad, new()
where TDice : IDice, new()
{
return TradeEncoding;
}
Expand Down
12 changes: 5 additions & 7 deletions catan-lib/Parts/ProductionCircle.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using CatanLib.Interfaces;
using CatanLib.Interfaces.Components;

namespace CatanLib.Parts
{
Expand All @@ -23,14 +23,12 @@ public float[] Encoding
}
}

public IEnumerable<float> ToVector()
public IEnumerable<float> ToVector<TSettlement, TRoad, TDice>(Catan<TSettlement, TRoad, TDice> catan)
where TSettlement : ISettlement, new()
where TRoad : IRoad, new()
where TDice : IDice, new()
{
return Encoding;
}

public IEnumerable<string> ToExplainedVector()
{
return new string[] { "NormalizedDiceRoll", "OddsOfDiceRoll" };
}
}
}
9 changes: 6 additions & 3 deletions catan-lib/Parts/TerrainTile.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using CatanLib.Enums;
using CatanLib.Interfaces;
using CatanLib.Interfaces.Components;
using HexagonLib;

namespace CatanLib.Parts
Expand Down Expand Up @@ -56,11 +56,14 @@ public IEnumerable<string> ToExplainedVector()
return vector;
}

public IEnumerable<float> ToVector()
public IEnumerable<float> ToVector<TSettlement, TRoad, TDice>(Catan<TSettlement, TRoad, TDice> catan)
where TSettlement : ISettlement, new()
where TRoad : IRoad, new()
where TDice : IDice, new()
{
IEnumerable<float> vector = Enumerable.Empty<float>();
vector = vector.Concat(TerrainEncoding);
vector = vector.Concat(Production.ToVector());
vector = vector.Concat(Production.ToVector(catan));
return vector;
}
}
Expand Down

0 comments on commit 66197d6

Please sign in to comment.