Almost working card state machine

This commit is contained in:
Michal Pikulski
2025-11-16 20:35:54 +01:00
parent 6fe7d012fc
commit 78aafb9275
42 changed files with 3057 additions and 3077 deletions

View File

@@ -1,7 +1,6 @@
using Core;
using Core.SaveLoad;
using UnityEngine;
using UnityEngine.EventSystems;
namespace UI.CardSystem.StateMachine.States
{
@@ -9,7 +8,7 @@ namespace UI.CardSystem.StateMachine.States
/// 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
public class CardPlacedInSlotState : AppleState, ICardClickHandler
{
private CardContext _context;
private AlbumCardSlot _parentSlot;
@@ -51,11 +50,11 @@ namespace UI.CardSystem.StateMachine.States
return _parentSlot;
}
public void OnPointerClick(PointerEventData eventData)
public void OnCardClicked(CardContext context)
{
// Click to enlarge when in album
Logging.Debug($"[CardPlacedInSlotState] Card clicked in slot, transitioning to enlarged state");
_context.StateMachine.ChangeState("AlbumEnlargedState");
context.StateMachine.ChangeState("AlbumEnlargedState");
}
}
}