33 lines
956 B
C#
33 lines
956 B
C#
namespace ET
|
|
{
|
|
[EnableClass]
|
|
public static class HeroPowerCalculatorTests
|
|
{
|
|
public static void TestPowerConsistency()
|
|
{
|
|
HeroInfo hero = HeroInfo.Create();
|
|
hero.heroId = 1;
|
|
hero.configId = 10001;
|
|
hero.level = 10;
|
|
hero.star = 3;
|
|
|
|
SkillInfo skill1 = SkillInfo.Create();
|
|
skill1.skillId = 1;
|
|
skill1.skillLevel = 2;
|
|
hero.skills.Add(skill1);
|
|
|
|
SkillInfo skill2 = SkillInfo.Create();
|
|
skill2.skillId = 2;
|
|
skill2.skillLevel = 3;
|
|
hero.skills.Add(skill2);
|
|
|
|
int serverPower = HeroPowerCalculator.GetPower(hero);
|
|
int clientPower = HeroPowerCalculator.GetPower(hero);
|
|
if (serverPower != clientPower)
|
|
{
|
|
throw new System.Exception($"Power mismatch: server={serverPower} client={clientPower}");
|
|
}
|
|
}
|
|
}
|
|
}
|