Working refactor of cleaned up card structure

This commit is contained in:
Michal Pikulski
2025-11-18 01:03:45 +01:00
parent 689e177c99
commit 64c304bb6d
18 changed files with 163 additions and 73 deletions

View File

@@ -87,7 +87,7 @@ namespace UI.CardSystem.StateMachine.States
{
Logging.Warning("[CardDraggingRevealedState] No target slot set - cannot place card");
// Return to corner
_context.StateMachine.ChangeState("PendingFaceDownState");
_context.StateMachine.ChangeState(CardStateNames.PendingFaceDown);
return;
}
@@ -95,11 +95,11 @@ namespace UI.CardSystem.StateMachine.States
var albumPage = _context.AlbumViewPage;
if (albumPage == null)
{
Logging.Warning("[CardDraggingRevealedState] AlbumViewPage not found - placing immediately");
Logging.Warning("[CardDraggingRevealedState] AlbumViewPage not injected - placing immediately");
TransitionToPlacement(_context);
return;
}
// Check if page is still flipping
if (albumPage.IsPageFlipping)
{
@@ -146,7 +146,7 @@ namespace UI.CardSystem.StateMachine.States
var card = ctx.GetComponent<Card>();
if (card != null)
{
var placedState = card.GetStateComponent<CardPlacedInSlotState>("PlacedInSlotState");
var placedState = card.GetStateComponent<CardPlacedInSlotState>(CardStateNames.PlacedInSlot);
if (placedState != null)
{
placedState.SetPlacementInfo(_targetSlot);
@@ -155,7 +155,7 @@ namespace UI.CardSystem.StateMachine.States
// Transition to PlacedInSlotState
// The state will handle animation and finalization in OnEnterState
ctx.StateMachine.ChangeState("PlacedInSlotState");
ctx.StateMachine.ChangeState(CardStateNames.PlacedInSlot);
}
private void OnDisable()