Refactor, cleanup code and add documentaiton
This commit is contained in:
51
Assets/Scripts/CardSystem/StateMachine/BoosterCardContext.cs
Normal file
51
Assets/Scripts/CardSystem/StateMachine/BoosterCardContext.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
using System;
|
||||
|
||||
namespace UI.CardSystem.StateMachine
|
||||
{
|
||||
/// <summary>
|
||||
/// Booster-specific card context for reveal flow coordination.
|
||||
/// Separated from generic CardContext to maintain single responsibility.
|
||||
/// </summary>
|
||||
public class BoosterCardContext
|
||||
{
|
||||
// Booster reveal workflow state
|
||||
private bool _hasCompletedReveal = false;
|
||||
|
||||
/// <summary>
|
||||
/// Has this card completed its booster reveal flow?
|
||||
/// </summary>
|
||||
public bool HasCompletedReveal => _hasCompletedReveal;
|
||||
|
||||
/// <summary>
|
||||
/// Suppress NEW/REPEAT badges in revealed state
|
||||
/// </summary>
|
||||
public bool SuppressRevealBadges { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Event fired when reveal flow is complete (card dismissed)
|
||||
/// </summary>
|
||||
public event Action OnRevealFlowComplete;
|
||||
|
||||
/// <summary>
|
||||
/// Signal that this card has completed its reveal flow
|
||||
/// </summary>
|
||||
public void NotifyRevealComplete()
|
||||
{
|
||||
if (!_hasCompletedReveal)
|
||||
{
|
||||
_hasCompletedReveal = true;
|
||||
OnRevealFlowComplete?.Invoke();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reset reveal state (for card reuse/pooling)
|
||||
/// </summary>
|
||||
public void Reset()
|
||||
{
|
||||
_hasCompletedReveal = false;
|
||||
SuppressRevealBadges = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user