switch set, automatize more of the content without UI change

This commit is contained in:
2025-10-11 00:53:40 +02:00
parent 55050c87f9
commit bf4ed2c74f
51 changed files with 11109 additions and 13677 deletions

View File

@@ -2,7 +2,7 @@ using System.Collections;
using System.Collections.Generic;
using NUnit.Framework;
namespace Assets.Data
namespace Tests.Editor
{
[TestFixture]
public class TestBitWise

View File

@@ -1,76 +1,77 @@
using System;
using System.Collections;
using System.Collections.Generic;
using NUnit.Framework;
// using System;
// using System.Collections;
// using System.Collections.Generic;
// using NUnit.Framework;
// using Set.Data;
namespace Assets.Data
{
[TestFixture]
public class TestChampionUtils
{
[Test]
[TestCaseSource(typeof(ChampionCase), "championsEnum")]
public void TestIntChampion(long champlong)
{
var champs = ChampionUtils.FromLong(champlong);
long output = ChampionUtils.ToLong(champs);
Assert.IsTrue(champlong == output);
}
// namespace Tests.Editor
// {
// [TestFixture]
// public class TestChampionUtils
// {
// [Test]
// [TestCaseSource(typeof(ChampionCase), "championsEnum")]
// public void TestIntChampion(long champlong)
// {
// var champs = ChampionUtils.FromLong(champlong);
// long output = ChampionUtils.ToLong(champs);
// Assert.IsTrue(champlong == output);
// }
[Test]
[TestCaseSource(typeof(ChampionCase), "championsNth")]
public void TestGetNthChampion(long champlons, int n, long expected)
{
long output = ChampionUtils.GetNthChampion(champlons, n);
Assert.IsTrue(output == expected);
}
}
// [Test]
// [TestCaseSource(typeof(ChampionCase), "championsNth")]
// public void TestGetNthChampion(long champlons, int n, long expected)
// {
// long output = ChampionUtils.GetNthChampion(champlons, n);
// Assert.IsTrue(output == expected);
// }
// }
public class ChampionCase
{
public static IEnumerable championsEnum
{
get
{
yield return 1223456L;
yield return 3422L;
yield return 97352L;
yield return 67855324254L;
yield return 432742125L;
yield return 76578256785L;
yield return 12345678912345678L;
}
}
// public class ChampionCase
// {
// public static IEnumerable championsEnum
// {
// get
// {
// yield return 1223456L;
// yield return 3422L;
// yield return 97352L;
// yield return 67855324254L;
// yield return 432742125L;
// yield return 76578256785L;
// yield return 12345678912345678L;
// }
// }
public static IEnumerable championsNth
{
get
{
yield return new TestCaseData(
ChampionUtils.ToLong(ChampionsEnum.ASHE),
0,
ChampionUtils.ToLong(ChampionsEnum.ASHE)
);
yield return new TestCaseData(
ChampionUtils.ToLong(ChampionsEnum.SMOLDER),
0,
ChampionUtils.ToLong(ChampionsEnum.SMOLDER)
);
yield return new TestCaseData(
ChampionUtils.ToLong(new HashSet<ChampionsEnum>() { ChampionsEnum.AHRI }),
0,
ChampionUtils.ToLong(ChampionsEnum.AHRI)
);
yield return new TestCaseData(
ChampionUtils.ToLong(new HashSet<ChampionsEnum>() {
ChampionsEnum.AHRI,
ChampionsEnum.POPPY,
ChampionsEnum.SORAKA,
ChampionsEnum.HWEI }),
1,
ChampionUtils.ToLong(ChampionsEnum.SORAKA)
);
}
}
}
}
// public static IEnumerable championsNth
// {
// get
// {
// yield return new TestCaseData(
// ChampionUtils.ToLong(ChampionsEnum.ASHE),
// 0,
// ChampionUtils.ToLong(ChampionsEnum.ASHE)
// );
// yield return new TestCaseData(
// ChampionUtils.ToLong(ChampionsEnum.SMOLDER),
// 0,
// ChampionUtils.ToLong(ChampionsEnum.SMOLDER)
// );
// yield return new TestCaseData(
// ChampionUtils.ToLong(new HashSet<ChampionsEnum>() { ChampionsEnum.AHRI }),
// 0,
// ChampionUtils.ToLong(ChampionsEnum.AHRI)
// );
// yield return new TestCaseData(
// ChampionUtils.ToLong(new HashSet<ChampionsEnum>() {
// ChampionsEnum.AHRI,
// ChampionsEnum.POPPY,
// ChampionsEnum.SORAKA,
// ChampionsEnum.HWEI }),
// 1,
// ChampionUtils.ToLong(ChampionsEnum.SORAKA)
// );
// }
// }
// }
// }

View File

@@ -1,292 +1,293 @@
using System.Collections;
using System.Collections.Generic;
using NUnit.Framework;
// using System.Collections;
// using System.Collections.Generic;
// using NUnit.Framework;
// using Set.Data;
namespace Assets.Data
{
[TestFixture]
public class TestTraitsMapping
{
[Test]
[TestCaseSource(typeof(TraitsMappingCase), "ChampCombination")]
public void TestChampCombination(
long mandatoryChamps,
long possibleChamps,
int n,
List<long> expected
)
{
List<long> output = TraitsMapping.GenerateCombinations(
mandatoryChamps,
possibleChamps,
n
);
foreach (long champ in expected)
{
Assert.IsTrue(output.Contains(champ));
}
// namespace Tests.Editor
// {
// [TestFixture]
// public class TestTraitsMapping
// // {
// [Test]
// [TestCaseSource(typeof(TraitsMappingCase), "ChampCombination")]
// public void TestChampCombination(
// long mandatoryChamps,
// long possibleChamps,
// int n,
// List<long> expected
// )
// {
// List<long> output = TraitsMapping.GenerateCombinations(
// mandatoryChamps,
// possibleChamps,
// n
// );
// foreach (long champ in expected)
// {
// Assert.IsTrue(output.Contains(champ));
// }
foreach (long champ in output)
{
Assert.IsTrue(expected.Contains(champ));
}
}
// foreach (long champ in output)
// {
// Assert.IsTrue(expected.Contains(champ));
// }
// }
[Test]
[TestCaseSource(typeof(TraitsMappingCase), "TestFilteringChampCombination")]
public void TestFilteringChampCombination(
long accessibleChampions,
long subselectedChampions,
long expected
)
{
var output = TraitsMapping.SelectSublistOfChampion(accessibleChampions, subselectedChampions);
Assert.AreEqual(expected, output);
}
}
// [Test]
// [TestCaseSource(typeof(TraitsMappingCase), "TestFilteringChampCombination")]
// public void TestFilteringChampCombination(
// long accessibleChampions,
// long subselectedChampions,
// long expected
// )
// {
// var output = TraitsMapping.SelectSublistOfChampion(accessibleChampions, subselectedChampions);
// Assert.AreEqual(expected, output);
// }
// }
public class TraitsMappingCase
{
public static IEnumerable ChampCombination
{
get
{
yield return new TestCaseData(
ChampionUtils.ToLong(
new HashSet<ChampionsEnum>()
{
ChampionsEnum.ASHE,
ChampionsEnum.BLITZCRANK,
}
),
ChampionUtils.ToLong(new HashSet<ChampionsEnum>() { ChampionsEnum.ELISE }),
3,
new List<long>()
{
ChampionUtils.ToLong(
new HashSet<ChampionsEnum>()
{
ChampionsEnum.ASHE,
ChampionsEnum.BLITZCRANK,
ChampionsEnum.ELISE,
}
),
}
);
// public class TraitsMappingCase
// {
// public static IEnumerable ChampCombination
// {
// get
// {
// yield return new TestCaseData(
// ChampionUtils.ToLong(
// new HashSet<ChampionsEnum>()
// {
// ChampionsEnum.ASHE,
// ChampionsEnum.BLITZCRANK,
// }
// ),
// ChampionUtils.ToLong(new HashSet<ChampionsEnum>() { ChampionsEnum.ELISE }),
// 3,
// new List<long>()
// {
// ChampionUtils.ToLong(
// new HashSet<ChampionsEnum>()
// {
// ChampionsEnum.ASHE,
// ChampionsEnum.BLITZCRANK,
// ChampionsEnum.ELISE,
// }
// ),
// }
// );
yield return new TestCaseData(
ChampionUtils.ToLong(
new HashSet<ChampionsEnum>()
{
ChampionsEnum.ASHE,
ChampionsEnum.BLITZCRANK,
}
),
ChampionUtils.ToLong(
new HashSet<ChampionsEnum>()
{
ChampionsEnum.ELISE,
ChampionsEnum.AHRI,
ChampionsEnum.CASSIOPEIA,
ChampionsEnum.EZREAL,
}
),
5,
new List<long>()
{
ChampionUtils.ToLong(
new HashSet<ChampionsEnum>()
{
ChampionsEnum.ASHE,
ChampionsEnum.BLITZCRANK,
ChampionsEnum.ELISE,
ChampionsEnum.AHRI,
ChampionsEnum.CASSIOPEIA,
}
),
ChampionUtils.ToLong(
new HashSet<ChampionsEnum>()
{
ChampionsEnum.ASHE,
ChampionsEnum.BLITZCRANK,
ChampionsEnum.ELISE,
ChampionsEnum.AHRI,
ChampionsEnum.EZREAL,
}
),
ChampionUtils.ToLong(
new HashSet<ChampionsEnum>()
{
ChampionsEnum.ASHE,
ChampionsEnum.BLITZCRANK,
ChampionsEnum.ELISE,
ChampionsEnum.CASSIOPEIA,
ChampionsEnum.EZREAL,
}
),
ChampionUtils.ToLong(
new HashSet<ChampionsEnum>()
{
ChampionsEnum.ASHE,
ChampionsEnum.BLITZCRANK,
ChampionsEnum.AHRI,
ChampionsEnum.CASSIOPEIA,
ChampionsEnum.EZREAL,
}
),
}
);
// yield return new TestCaseData(
// ChampionUtils.ToLong(
// new HashSet<ChampionsEnum>()
// {
// ChampionsEnum.ASHE,
// ChampionsEnum.BLITZCRANK,
// }
// ),
// ChampionUtils.ToLong(
// new HashSet<ChampionsEnum>()
// {
// ChampionsEnum.ELISE,
// ChampionsEnum.AHRI,
// ChampionsEnum.CASSIOPEIA,
// ChampionsEnum.EZREAL,
// }
// ),
// 5,
// new List<long>()
// {
// ChampionUtils.ToLong(
// new HashSet<ChampionsEnum>()
// {
// ChampionsEnum.ASHE,
// ChampionsEnum.BLITZCRANK,
// ChampionsEnum.ELISE,
// ChampionsEnum.AHRI,
// ChampionsEnum.CASSIOPEIA,
// }
// ),
// ChampionUtils.ToLong(
// new HashSet<ChampionsEnum>()
// {
// ChampionsEnum.ASHE,
// ChampionsEnum.BLITZCRANK,
// ChampionsEnum.ELISE,
// ChampionsEnum.AHRI,
// ChampionsEnum.EZREAL,
// }
// ),
// ChampionUtils.ToLong(
// new HashSet<ChampionsEnum>()
// {
// ChampionsEnum.ASHE,
// ChampionsEnum.BLITZCRANK,
// ChampionsEnum.ELISE,
// ChampionsEnum.CASSIOPEIA,
// ChampionsEnum.EZREAL,
// }
// ),
// ChampionUtils.ToLong(
// new HashSet<ChampionsEnum>()
// {
// ChampionsEnum.ASHE,
// ChampionsEnum.BLITZCRANK,
// ChampionsEnum.AHRI,
// ChampionsEnum.CASSIOPEIA,
// ChampionsEnum.EZREAL,
// }
// ),
// }
// );
yield return new TestCaseData(
ChampionUtils.ToLong(
new HashSet<ChampionsEnum>() { ChampionsEnum.AHRI, ChampionsEnum.AKALI }
),
ChampionUtils.ToLong(new HashSet<ChampionsEnum>() { ChampionsEnum.ELISE }),
3,
new List<long>()
{
ChampionUtils.ToLong(
new HashSet<ChampionsEnum>()
{
ChampionsEnum.AHRI,
ChampionsEnum.AKALI,
ChampionsEnum.ELISE,
}
),
}
);
// yield return new TestCaseData(
// ChampionUtils.ToLong(
// new HashSet<ChampionsEnum>() { ChampionsEnum.AHRI, ChampionsEnum.AKALI }
// ),
// ChampionUtils.ToLong(new HashSet<ChampionsEnum>() { ChampionsEnum.ELISE }),
// 3,
// new List<long>()
// {
// ChampionUtils.ToLong(
// new HashSet<ChampionsEnum>()
// {
// ChampionsEnum.AHRI,
// ChampionsEnum.AKALI,
// ChampionsEnum.ELISE,
// }
// ),
// }
// );
yield return new TestCaseData(
ChampionUtils.ToLong(
new HashSet<ChampionsEnum>()
{
ChampionsEnum.AHRI,
ChampionsEnum.POPPY,
ChampionsEnum.SORAKA,
ChampionsEnum.XERATH,
}
),
ChampionUtils.ToLong(
new HashSet<ChampionsEnum>()
{
ChampionsEnum.SMOLDER,
ChampionsEnum.MORDEKAISER,
}
),
4,
new List<long>()
{
ChampionUtils.ToLong(
new HashSet<ChampionsEnum>()
{
ChampionsEnum.AHRI,
ChampionsEnum.POPPY,
ChampionsEnum.SORAKA,
ChampionsEnum.XERATH,
}
),
}
);
// yield return new TestCaseData(
// ChampionUtils.ToLong(
// new HashSet<ChampionsEnum>()
// {
// ChampionsEnum.AHRI,
// ChampionsEnum.POPPY,
// ChampionsEnum.SORAKA,
// ChampionsEnum.XERATH,
// }
// ),
// ChampionUtils.ToLong(
// new HashSet<ChampionsEnum>()
// {
// ChampionsEnum.SMOLDER,
// ChampionsEnum.MORDEKAISER,
// }
// ),
// 4,
// new List<long>()
// {
// ChampionUtils.ToLong(
// new HashSet<ChampionsEnum>()
// {
// ChampionsEnum.AHRI,
// ChampionsEnum.POPPY,
// ChampionsEnum.SORAKA,
// ChampionsEnum.XERATH,
// }
// ),
// }
// );
yield return new TestCaseData(
ChampionUtils.ToLong(
new HashSet<ChampionsEnum>()
{
ChampionsEnum.RUMBLE,
ChampionsEnum.GALIO,
ChampionsEnum.AKALI,
ChampionsEnum.BARD,
}
),
ChampionUtils.ToLong(
new HashSet<ChampionsEnum>()
{
ChampionsEnum.MORGANA,
ChampionsEnum.FIORA,
ChampionsEnum.VARUS,
}
),
7,
new List<long>()
{
ChampionUtils.ToLong(
new HashSet<ChampionsEnum>()
{
ChampionsEnum.RUMBLE,
ChampionsEnum.GALIO,
ChampionsEnum.AKALI,
ChampionsEnum.BARD,
ChampionsEnum.MORGANA,
ChampionsEnum.FIORA,
ChampionsEnum.VARUS
}
),
}
);
// yield return new TestCaseData(
// ChampionUtils.ToLong(
// new HashSet<ChampionsEnum>()
// {
// ChampionsEnum.RUMBLE,
// ChampionsEnum.GALIO,
// ChampionsEnum.AKALI,
// ChampionsEnum.BARD,
// }
// ),
// ChampionUtils.ToLong(
// new HashSet<ChampionsEnum>()
// {
// ChampionsEnum.MORGANA,
// ChampionsEnum.FIORA,
// ChampionsEnum.VARUS,
// }
// ),
// 7,
// new List<long>()
// {
// ChampionUtils.ToLong(
// new HashSet<ChampionsEnum>()
// {
// ChampionsEnum.RUMBLE,
// ChampionsEnum.GALIO,
// ChampionsEnum.AKALI,
// ChampionsEnum.BARD,
// ChampionsEnum.MORGANA,
// ChampionsEnum.FIORA,
// ChampionsEnum.VARUS
// }
// ),
// }
// );
yield return new TestCaseData(
ChampionUtils.ToLong(
new HashSet<ChampionsEnum>()
{
ChampionsEnum.RUMBLE,
ChampionsEnum.GALIO,
ChampionsEnum.AKALI,
ChampionsEnum.BARD,
ChampionsEnum.MORGANA,
ChampionsEnum.FIORA,
ChampionsEnum.VARUS
}
),
ChampionUtils.ToLong(
new HashSet<ChampionsEnum>()
{
ChampionsEnum.XERATH
}
),
7,
new List<long>()
{
ChampionUtils.ToLong(
new HashSet<ChampionsEnum>()
{
ChampionsEnum.RUMBLE,
ChampionsEnum.GALIO,
ChampionsEnum.AKALI,
ChampionsEnum.BARD,
ChampionsEnum.MORGANA,
ChampionsEnum.FIORA,
ChampionsEnum.VARUS
}
),
}
);
}
}
// yield return new TestCaseData(
// ChampionUtils.ToLong(
// new HashSet<ChampionsEnum>()
// {
// ChampionsEnum.RUMBLE,
// ChampionsEnum.GALIO,
// ChampionsEnum.AKALI,
// ChampionsEnum.BARD,
// ChampionsEnum.MORGANA,
// ChampionsEnum.FIORA,
// ChampionsEnum.VARUS
// }
// ),
// ChampionUtils.ToLong(
// new HashSet<ChampionsEnum>()
// {
// ChampionsEnum.XERATH
// }
// ),
// 7,
// new List<long>()
// {
// ChampionUtils.ToLong(
// new HashSet<ChampionsEnum>()
// {
// ChampionsEnum.RUMBLE,
// ChampionsEnum.GALIO,
// ChampionsEnum.AKALI,
// ChampionsEnum.BARD,
// ChampionsEnum.MORGANA,
// ChampionsEnum.FIORA,
// ChampionsEnum.VARUS
// }
// ),
// }
// );
// }
// }
public static IEnumerable TestFilteringChampCombination
{
get
{
yield return new TestCaseData(
ChampionUtils.ToLong(
new HashSet<ChampionsEnum>()
{
ChampionsEnum.ASHE,
ChampionsEnum.BLITZCRANK,
ChampionsEnum.ELISE,
ChampionsEnum.JAX
}
),
0b0101,
ChampionUtils.ToLong(
new HashSet<ChampionsEnum>()
{
ChampionsEnum.ASHE,
ChampionsEnum.ELISE
}
)
);
}
}
}
}
// public static IEnumerable TestFilteringChampCombination
// {
// get
// {
// yield return new TestCaseData(
// ChampionUtils.ToLong(
// new HashSet<ChampionsEnum>()
// {
// ChampionsEnum.ASHE,
// ChampionsEnum.BLITZCRANK,
// ChampionsEnum.ELISE,
// ChampionsEnum.JAX
// }
// ),
// 0b0101,
// ChampionUtils.ToLong(
// new HashSet<ChampionsEnum>()
// {
// ChampionsEnum.ASHE,
// ChampionsEnum.ELISE
// }
// )
// );
// }
// }
// }
// }

View File

@@ -1,8 +1,9 @@
using System.Collections;
using System.Collections.Generic;
using NUnit.Framework;
using Set.Data;
namespace Assets.Data
namespace Tests.Editor
{
[TestFixture]
public class TestTraitsUtils
@@ -92,65 +93,46 @@ namespace Assets.Data
get
{
yield return new TestCaseData(
new Dictionary<int, int> { { (int)TraitsEnum.ARCANA, 1 } },
new Dictionary<int, int> { { (int)TraitsEnum.ARCANA, 1 } },
new Dictionary<int, int> { { (int)TraitsEnum.ARCANA, 2 } }
new Dictionary<int, int> { { (int)TraitsEnum.BATTLEACADEMIA, 1 } },
new Dictionary<int, int> { { (int)TraitsEnum.BATTLEACADEMIA, 1 } },
new Dictionary<int, int> { { (int)TraitsEnum.BATTLEACADEMIA, 2 } }
);
yield return new TestCaseData(
new Dictionary<int, int>
{
{ (int)TraitsEnum.ARCANA, 1 },
{ (int)TraitsEnum.DRAGON, 2 },
{ (int)TraitsEnum.FROST, 3 },
{ (int)TraitsEnum.HONEYMANCY, 4 },
{ (int)TraitsEnum.PYRO, 5 },
{ (int)TraitsEnum.WARRIOR, 6 },
{ (int)TraitsEnum.BATTLEACADEMIA, 1 },
{ (int)TraitsEnum.CRYSTALGAMBIT, 2 },
{ (int)TraitsEnum.LUCHADOR, 3 },
{ (int)TraitsEnum.MIGHTYMECH, 4 },
{ (int)TraitsEnum.SOULFIGHTER, 5 },
{ (int)TraitsEnum.BASTION, 6 },
},
new Dictionary<int, int>
{
{ (int)TraitsEnum.ARCANA, 1 },
{ (int)TraitsEnum.DRAGON, 2 },
{ (int)TraitsEnum.FROST, 3 },
{ (int)TraitsEnum.HONEYMANCY, 4 },
{ (int)TraitsEnum.PYRO, 5 },
{ (int)TraitsEnum.WARRIOR, 6 },
{ (int)TraitsEnum.BATTLEACADEMIA, 1 },
{ (int)TraitsEnum.CRYSTALGAMBIT, 2 },
{ (int)TraitsEnum.LUCHADOR, 3 },
{ (int)TraitsEnum.MIGHTYMECH, 4 },
{ (int)TraitsEnum.SOULFIGHTER, 5 },
{ (int)TraitsEnum.BASTION, 6 },
},
new Dictionary<int, int>
{
{ (int)TraitsEnum.ARCANA, 2 },
{ (int)TraitsEnum.DRAGON, 4 },
{ (int)TraitsEnum.FROST, 6 },
{ (int)TraitsEnum.HONEYMANCY, 8 },
{ (int)TraitsEnum.PYRO, 10 },
{ (int)TraitsEnum.WARRIOR, 12 },
{ (int)TraitsEnum.BATTLEACADEMIA, 2 },
{ (int)TraitsEnum.CRYSTALGAMBIT, 4 },
{ (int)TraitsEnum.LUCHADOR, 6 },
{ (int)TraitsEnum.MIGHTYMECH, 8 },
{ (int)TraitsEnum.SOULFIGHTER, 10 },
{ (int)TraitsEnum.BASTION, 12 },
}
);
/*
here is the list of traits :
ARCANA,
CHRONO,
DRAGON,
DRUID,
ELDRICHT,
FAERIE,
FROST,
HONEYMANCY,
PORTAL,
PYRO,
SUGARCRAFT,
WITCHCRAFT,
BASTION,
BLASTER,
HUNTER,
INCANTATOR,
MAGE,
MULTISTRIKER,
PRESERVER,
SCHOLAR,
SHAPESHIFTER,
VANGUARD,
WARRIOR
Set 15 traits list:
Origins: BATTLEACADEMIA, CRYSTALGAMBIT, LUCHADOR, MIGHTYMECH, MONSTERTRAINER,
SOULFIGHTER, STARGUARDIAN, SUPREMECELLS, THECREW, WRAITH, MENTOR,
PRODIGY, THECHAMP, STANCEMASTER, ROGUECAPTAIN
Classes: BASTION, DUELIST, EDGELORD, EXECUTIONER, HEAVYWEIGHT, JUGGERNAUT,
PROTECTOR, SNIPER, SORCERER, STRATEGIST
*/
}
}
@@ -162,19 +144,19 @@ namespace Assets.Data
yield return new TestCaseData(
new Dictionary<int, int>
{
{ (int)TraitsEnum.ARCANA, 1 },
{ (int)TraitsEnum.DRAGON, 2 },
{ (int)TraitsEnum.FROST, 3 },
{ (int)TraitsEnum.HONEYMANCY, 4 },
{ (int)TraitsEnum.PYRO, 1 },
{ (int)TraitsEnum.WARRIOR, 1 },
{ (int)TraitsEnum.BATTLEACADEMIA, 1 },
{ (int)TraitsEnum.CRYSTALGAMBIT, 2 },
{ (int)TraitsEnum.LUCHADOR, 3 },
{ (int)TraitsEnum.MIGHTYMECH, 4 },
{ (int)TraitsEnum.SOULFIGHTER, 1 },
{ (int)TraitsEnum.BASTION, 1 },
},
TraitUtils.ToInt(
new HashSet<TraitsEnum>
{
TraitsEnum.DRAGON,
TraitsEnum.FROST,
TraitsEnum.HONEYMANCY
TraitsEnum.CRYSTALGAMBIT,
TraitsEnum.LUCHADOR,
TraitsEnum.MIGHTYMECH
}
)
);
@@ -182,19 +164,19 @@ namespace Assets.Data
yield return new TestCaseData(
new Dictionary<int, int>
{
{ (int)TraitsEnum.ARCANA, 5 },
{ (int)TraitsEnum.FROST, 2 },
{ (int)TraitsEnum.HONEYMANCY, 7 },
{ (int)TraitsEnum.PYRO, 4 },
{ (int)TraitsEnum.WARRIOR, 3 },
{ (int)TraitsEnum.BATTLEACADEMIA, 5 },
{ (int)TraitsEnum.LUCHADOR, 2 },
{ (int)TraitsEnum.STARGUARDIAN, 7 },
{ (int)TraitsEnum.SOULFIGHTER, 4 },
{ (int)TraitsEnum.BASTION, 3 },
},
TraitUtils.ToInt(
new HashSet<TraitsEnum>
{
TraitsEnum.ARCANA,
TraitsEnum.HONEYMANCY,
TraitsEnum.PYRO,
TraitsEnum.WARRIOR,
TraitsEnum.BATTLEACADEMIA,
TraitsEnum.STARGUARDIAN,
TraitsEnum.SOULFIGHTER,
TraitsEnum.BASTION
}
)
);
@@ -214,53 +196,55 @@ namespace Assets.Data
}
}
public static IEnumerable traitsToInt
public static IEnumerable traitsToInt
{
get
{
yield return new TestCaseData(
new HashSet<TraitsEnum>
{
TraitsEnum.ARCANA,
TraitsEnum.DRAGON
TraitsEnum.BATTLEACADEMIA,
TraitsEnum.CRYSTALGAMBIT
},
1<<0 | 1<<2
1 << 0 | 1 << 1
);
yield return new TestCaseData(
new HashSet<TraitsEnum>
{
TraitsEnum.ARCANA,
TraitsEnum.DRAGON,
TraitsEnum.FROST,
TraitsEnum.HONEYMANCY,
TraitsEnum.PYRO,
TraitsEnum.WARRIOR
TraitsEnum.BATTLEACADEMIA,
TraitsEnum.CRYSTALGAMBIT,
TraitsEnum.LUCHADOR,
TraitsEnum.MIGHTYMECH,
TraitsEnum.SOULFIGHTER,
TraitsEnum.BASTION
},
1<<0 | 1<<2 | 1<<6 | 1<<7 | 1<<9 | 1<<22
);
yield return new TestCaseData(new HashSet<TraitsEnum>{TraitsEnum.ARCANA},1 << 0);
yield return new TestCaseData(new HashSet<TraitsEnum>{TraitsEnum.CHRONO},1 << 1);
yield return new TestCaseData(new HashSet<TraitsEnum>{TraitsEnum.DRAGON},1 << 2);
yield return new TestCaseData(new HashSet<TraitsEnum>{TraitsEnum.DRUID},1 << 3);
yield return new TestCaseData(new HashSet<TraitsEnum>{TraitsEnum.ELDRICHT},1 << 4);
yield return new TestCaseData(new HashSet<TraitsEnum>{TraitsEnum.FAERIE},1 << 5);
yield return new TestCaseData(new HashSet<TraitsEnum>{TraitsEnum.FROST},1 << 6);
yield return new TestCaseData(new HashSet<TraitsEnum>{TraitsEnum.HONEYMANCY},1 << 7);
yield return new TestCaseData(new HashSet<TraitsEnum>{TraitsEnum.PORTAL},1 << 8);
yield return new TestCaseData(new HashSet<TraitsEnum>{TraitsEnum.PYRO},1 << 9);
yield return new TestCaseData(new HashSet<TraitsEnum>{TraitsEnum.SUGARCRAFT},1 << 10);
yield return new TestCaseData(new HashSet<TraitsEnum>{TraitsEnum.WITCHCRAFT},1 << 11);
yield return new TestCaseData(new HashSet<TraitsEnum>{TraitsEnum.BASTION},1 << 12);
yield return new TestCaseData(new HashSet<TraitsEnum>{TraitsEnum.BLASTER},1 << 13);
yield return new TestCaseData(new HashSet<TraitsEnum>{TraitsEnum.HUNTER},1 << 14);
yield return new TestCaseData(new HashSet<TraitsEnum>{TraitsEnum.INCANTATOR},1 << 15);
yield return new TestCaseData(new HashSet<TraitsEnum>{TraitsEnum.MAGE},1 << 16);
yield return new TestCaseData(new HashSet<TraitsEnum>{TraitsEnum.MULTISTRIKER},1 << 17);
yield return new TestCaseData(new HashSet<TraitsEnum>{TraitsEnum.PRESERVER},1 << 18);
yield return new TestCaseData(new HashSet<TraitsEnum>{TraitsEnum.SCHOLAR},1 << 19);
yield return new TestCaseData(new HashSet<TraitsEnum>{TraitsEnum.SHAPESHIFTER},1 << 20);
yield return new TestCaseData(new HashSet<TraitsEnum>{TraitsEnum.VANGUARD},1 << 21);
yield return new TestCaseData(new HashSet<TraitsEnum>{TraitsEnum.WARRIOR},1 << 22);
1 << 0 | 1 << 1 | 1 << 2 | 1 << 3 | 1 << 5 | 1 << 15
);
yield return new TestCaseData(new HashSet<TraitsEnum> { TraitsEnum.BATTLEACADEMIA }, 1 << 0);
yield return new TestCaseData(new HashSet<TraitsEnum> { TraitsEnum.CRYSTALGAMBIT }, 1 << 1);
yield return new TestCaseData(new HashSet<TraitsEnum> { TraitsEnum.LUCHADOR }, 1 << 2);
yield return new TestCaseData(new HashSet<TraitsEnum> { TraitsEnum.MIGHTYMECH }, 1 << 3);
yield return new TestCaseData(new HashSet<TraitsEnum> { TraitsEnum.MONSTERTRAINER }, 1 << 4);
yield return new TestCaseData(new HashSet<TraitsEnum> { TraitsEnum.SOULFIGHTER }, 1 << 5);
yield return new TestCaseData(new HashSet<TraitsEnum> { TraitsEnum.STARGUARDIAN }, 1 << 6);
yield return new TestCaseData(new HashSet<TraitsEnum> { TraitsEnum.SUPREMECELLS }, 1 << 7);
yield return new TestCaseData(new HashSet<TraitsEnum> { TraitsEnum.THECREW }, 1 << 8);
yield return new TestCaseData(new HashSet<TraitsEnum> { TraitsEnum.WRAITH }, 1 << 9);
yield return new TestCaseData(new HashSet<TraitsEnum> { TraitsEnum.MENTOR }, 1 << 10);
yield return new TestCaseData(new HashSet<TraitsEnum> { TraitsEnum.PRODIGY }, 1 << 11);
yield return new TestCaseData(new HashSet<TraitsEnum> { TraitsEnum.THECHAMP }, 1 << 12);
yield return new TestCaseData(new HashSet<TraitsEnum> { TraitsEnum.STANCEMASTER }, 1 << 13);
yield return new TestCaseData(new HashSet<TraitsEnum> { TraitsEnum.ROGUECAPTAIN }, 1 << 14);
yield return new TestCaseData(new HashSet<TraitsEnum> { TraitsEnum.BASTION }, 1 << 15);
yield return new TestCaseData(new HashSet<TraitsEnum> { TraitsEnum.DUELIST }, 1 << 16);
yield return new TestCaseData(new HashSet<TraitsEnum> { TraitsEnum.EDGELORD }, 1 << 17);
yield return new TestCaseData(new HashSet<TraitsEnum> { TraitsEnum.EXECUTIONER }, 1 << 18);
yield return new TestCaseData(new HashSet<TraitsEnum> { TraitsEnum.HEAVYWEIGHT }, 1 << 19);
yield return new TestCaseData(new HashSet<TraitsEnum> { TraitsEnum.JUGGERNAUT }, 1 << 20);
yield return new TestCaseData(new HashSet<TraitsEnum> { TraitsEnum.PROTECTOR }, 1 << 21);
yield return new TestCaseData(new HashSet<TraitsEnum> { TraitsEnum.SNIPER }, 1 << 22);
yield return new TestCaseData(new HashSet<TraitsEnum> { TraitsEnum.SORCERER }, 1 << 23);
yield return new TestCaseData(new HashSet<TraitsEnum> { TraitsEnum.STRATEGIST }, 1 << 24);
}
}
}