feat: 허수아비 계산 시뮬레이터 추가
- 빌드 입력, 룰셋, 회전 정책, 결과/리포트 모델을 포함한 데미지 계산 시뮬레이터 기반을 추가 - 단일 실행 창과 배치 전수 조사 창, 플레이어 데미지 스윕 메뉴를 추가 - DamageEffect 계산값 접근자를 열어 기존 전투 공식을 시뮬레이터에서 재사용하도록 정리
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Colosseum.Combat.Simulation
|
||||
{
|
||||
/// <summary>
|
||||
/// 여러 빌드를 순회하며 배치 시뮬레이션을 실행합니다.
|
||||
/// </summary>
|
||||
public static class SimulationBatchRunner
|
||||
{
|
||||
/// <summary>
|
||||
/// 생성된 빌드 목록을 순회 실행하고 결과를 묶어 반환합니다.
|
||||
/// </summary>
|
||||
public static SimulationBatchResult Run(
|
||||
string batchName,
|
||||
IReadOnlyList<BuildSimulationInput> builds,
|
||||
SimulationRuleSet ruleSet,
|
||||
RotationPolicy rotationPolicy,
|
||||
IReadOnlyList<string> generationWarnings,
|
||||
bool truncated)
|
||||
{
|
||||
List<SimulationBatchEntry> entries = new List<SimulationBatchEntry>();
|
||||
List<string> warnings = new List<string>();
|
||||
|
||||
if (generationWarnings != null)
|
||||
{
|
||||
for (int i = 0; i < generationWarnings.Count; i++)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(generationWarnings[i]))
|
||||
warnings.Add(generationWarnings[i]);
|
||||
}
|
||||
}
|
||||
|
||||
if (builds != null)
|
||||
{
|
||||
for (int i = 0; i < builds.Count; i++)
|
||||
{
|
||||
BuildSimulationInput build = builds[i];
|
||||
if (build == null)
|
||||
continue;
|
||||
|
||||
SimulationResult result = BuildSimulationEngine.Run(build, ruleSet, rotationPolicy);
|
||||
entries.Add(new SimulationBatchEntry(build.BuildLabel, result));
|
||||
}
|
||||
}
|
||||
|
||||
entries.Sort((left, right) =>
|
||||
{
|
||||
float leftDps = left != null && left.Result != null ? left.Result.AverageDps : 0f;
|
||||
float rightDps = right != null && right.Result != null ? right.Result.AverageDps : 0f;
|
||||
return rightDps.CompareTo(leftDps);
|
||||
});
|
||||
|
||||
SimulationBatchResult batchResult = new SimulationBatchResult();
|
||||
batchResult.Initialize(batchName, builds != null ? builds.Count : 0, truncated, entries, warnings);
|
||||
return batchResult;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user