98 lines
2.8 KiB
C#
98 lines
2.8 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using GameCore;
|
|
using asap.core;
|
|
|
|
public class EventPartnerStatueTestScript : MonoBehaviour
|
|
{
|
|
private void Start()
|
|
{
|
|
|
|
}
|
|
|
|
|
|
#if UNITY_EDITOR
|
|
private void Update()
|
|
{
|
|
if (Input.GetKeyDown(KeyCode.Space))
|
|
{
|
|
TestRollMethod();
|
|
}
|
|
}
|
|
|
|
private void TestStageTrick()
|
|
{
|
|
|
|
}
|
|
|
|
private void TestRollMethod()
|
|
{
|
|
/* var arc = GContext.container.Resolve<EventPartnerStatueArc>();
|
|
|
|
// Initialize test data if not already done
|
|
if (arc.TableContext == null || arc.Model == null)
|
|
{
|
|
arc.InitTest();
|
|
}
|
|
|
|
// Ensure we have enough tickets for testing
|
|
arc.Model.TicketCount = 10000; // Set a high ticket count for testing
|
|
|
|
// Run multiple rolls to analyze distribution
|
|
Dictionary<string, int> patternCount = new Dictionary<string, int>();
|
|
List<int> points = new List<int>();
|
|
int totalRolls = 1000;
|
|
|
|
for (int i = 0; i < totalRolls; i++)
|
|
{
|
|
(var point, var pattern) = arc.Roll(1);
|
|
string patternKey = string.Join(",", pattern);
|
|
|
|
if (patternCount.ContainsKey(patternKey))
|
|
{
|
|
patternCount[patternKey]++;
|
|
}
|
|
else
|
|
{
|
|
patternCount[patternKey] = 1;
|
|
}
|
|
|
|
points.Add(point);
|
|
}
|
|
|
|
// Calculate and log distribution statistics
|
|
Debug.Log($"[EventPartnerStatueMainPanel] Roll Distribution Analysis ({totalRolls} rolls):");
|
|
foreach (var kvp in patternCount)
|
|
{
|
|
float percentage = (float)kvp.Value / totalRolls * 100;
|
|
Debug.Log($"Pattern [{kvp.Key}]: {kvp.Value} times ({percentage:F2}%)");
|
|
}
|
|
|
|
// Calculate average point value
|
|
// float avgPoint = points.Average();
|
|
// int minPoint = points.Min();
|
|
// int maxPoint = points.Max();
|
|
|
|
// Debug.Log($"[EventPartnerStatueMainPanel] Point Statistics:");
|
|
// Debug.Log($"Average Point: {avgPoint:F2}");
|
|
// Debug.Log($"Min Point: {minPoint}");
|
|
// Debug.Log($"Max Point: {maxPoint}");
|
|
|
|
// Check for special patterns if they exist
|
|
var freePattern = string.Join(",", arc.TableContext.GetFreeDisplayPattern());
|
|
var morePattern = string.Join(",", arc.TableContext.GetMoreDisplayPattern());
|
|
|
|
if (patternCount.ContainsKey(freePattern))
|
|
{
|
|
Debug.Log($"[EventPartnerStatueMainPanel] Free Pattern [{freePattern}] appeared: {patternCount[freePattern]} times");
|
|
}
|
|
if (patternCount.ContainsKey(morePattern))
|
|
{
|
|
Debug.Log($"[EventPartnerStatueMainPanel] More Pattern [{morePattern}] appeared: {patternCount[morePattern]} times");
|
|
}
|
|
*/ }
|
|
#endif
|
|
}
|