final push

This commit is contained in:
2024-09-25 12:12:33 +02:00
parent 27f87cefda
commit 55050c87f9
5 changed files with 1063 additions and 226 deletions

View File

@@ -10,6 +10,8 @@ namespace Assets.Data
public class TraitsMapping : MonoBehaviour
{
// long for champion, int for traits
public static int TotalChampionCout = 60;
public static int TotalTraitCount = 23;
public static Dictionary<long, int> ChampsTraits = new Dictionary<long, int>
{
{
@@ -844,14 +846,14 @@ namespace Assets.Data
public static Dictionary<int, int> TraitCountInCompo(long compo)
{
Dictionary<int, int> synergies = new Dictionary<int, int>();
for (int i = 0; i < 60; i++)
for (int i = 0; i < TotalChampionCout; i++)
{
if ((compo & (1L << i)) != 0)
{
var champ = (long)(1L << i);
var traits = ChampsTraits[champ];
// combine the traits within synergies using bitwise operation
for (int trait = 0; trait < 22; trait++)
for (int trait = 0; trait < TotalTraitCount; trait++)
{
if ((traits & (1 << trait)) != 0)
{
@@ -970,6 +972,8 @@ namespace Assets.Data
long possibleChamps,
int compositionSize
) {
possibleChamps = possibleChamps & ~mandatoryChamps;
Assert.IsTrue((mandatoryChamps & possibleChamps) == 0);
List<long> compositions = new List<long>();