Update the card kerfufle
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
using Core;
|
||||
using Core.SaveLoad;
|
||||
using UnityEngine.EventSystems;
|
||||
|
||||
namespace UI.CardSystem.StateMachine.States
|
||||
{
|
||||
/// <summary>
|
||||
/// Placed in slot state - card is in an album slot and can be clicked to enlarge.
|
||||
/// Manages the parent slot reference.
|
||||
/// </summary>
|
||||
public class CardPlacedInSlotState : AppleState, IPointerClickHandler
|
||||
{
|
||||
private CardContext _context;
|
||||
private AlbumCardSlot _parentSlot;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
_context = GetComponentInParent<CardContext>();
|
||||
}
|
||||
|
||||
public override void OnEnterState()
|
||||
{
|
||||
Logging.Debug($"[CardPlacedInSlotState] Card placed in slot: {_context.CardData?.Name}");
|
||||
|
||||
// Card is now part of the album, no special visuals needed
|
||||
// Just wait for interaction
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set the parent slot this card belongs to
|
||||
/// </summary>
|
||||
public void SetParentSlot(AlbumCardSlot slot)
|
||||
{
|
||||
_parentSlot = slot;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the parent slot
|
||||
/// </summary>
|
||||
public AlbumCardSlot GetParentSlot()
|
||||
{
|
||||
return _parentSlot;
|
||||
}
|
||||
|
||||
public void OnPointerClick(PointerEventData eventData)
|
||||
{
|
||||
// Click to enlarge when in album
|
||||
Logging.Debug($"[CardPlacedInSlotState] Card clicked in slot, transitioning to enlarged state");
|
||||
_context.StateMachine.ChangeState("AlbumEnlargedState");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user