Merge pull request #81 from Degulleo/DO-82-리플레이-이전했을-경우-마지막-돌-표시-버그

DO-82 [Fix] 리플레이 마지막 돌 상태 버그 수정
This commit is contained in:
Lim0_C 2025-03-28 14:21:05 +09:00 committed by GitHub
commit 297fe48f6a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 16 additions and 0 deletions

View File

@ -86,4 +86,10 @@
ReplayManager.Instance.SaveReplayDataResult(result); ReplayManager.Instance.SaveReplayDataResult(result);
//TODO: 게임 종료 후 행동 구현 //TODO: 게임 종료 후 행동 구현
} }
public void SetLastPositioned(int row, int col)
{
_lastRow = row;
_lastCol = col;
}
} }

View File

@ -215,6 +215,16 @@ public class ReplayManager : Singleton<ReplayManager>
{ {
ReplayManager.Instance.PushUndoMove(targetMove); ReplayManager.Instance.PushUndoMove(targetMove);
_gameLogic.RemoveStone(targetMove.columnIndex, targetMove.rowIndex); _gameLogic.RemoveStone(targetMove.columnIndex, targetMove.rowIndex);
if (_placedStoneStack.Count > 0)
{
var undoLastMove = _placedStoneStack.Peek();
_gameLogic.StoneController.SetStoneState(Enums.StoneState.LastPositioned, undoLastMove.columnIndex, undoLastMove.rowIndex);
_gameLogic.SetLastPositioned(undoLastMove.columnIndex, undoLastMove.rowIndex);
}
else
{
_gameLogic.SetLastPositioned(-1, -1);
}
} }
public void ReplayFirst() public void ReplayFirst()