From 7c88cf5a0070403d4cebeb4dcfb07d8666955bef Mon Sep 17 00:00:00 2001 From: Lim0_C Date: Fri, 14 Mar 2025 11:49:58 +0900 Subject: [PATCH] =?UTF-8?q?DO-8=20BoardValue=20=EC=83=81=EC=88=98=EB=AA=85?= =?UTF-8?q?=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Script/Game/StoneController.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Assets/Script/Game/StoneController.cs b/Assets/Script/Game/StoneController.cs index d371148..e3dd3f7 100644 --- a/Assets/Script/Game/StoneController.cs +++ b/Assets/Script/Game/StoneController.cs @@ -9,7 +9,7 @@ public class StoneController : MonoBehaviour public delegate void OnStoneClicked(int row, int col); public OnStoneClicked OnStoneClickedDelegate; //네이밍 필요 - public const int BoardValue = 15; + public const int MaxCellCount = 15; //Stone 객체들 초기화 함수 호출 public void InitStones() @@ -18,8 +18,8 @@ public class StoneController : MonoBehaviour { stones[i].InitStone(i, (index) => { - var rowIndex = index / BoardValue; - var colIndex = index % BoardValue; + var rowIndex = index / MaxCellCount; + var colIndex = index % MaxCellCount; OnStoneClickedDelegate?.Invoke(rowIndex, colIndex); }); } @@ -28,14 +28,14 @@ public class StoneController : MonoBehaviour public void SetStoneType(Enums.StoneType stoneType, int row, int col) { - var index = BoardValue * row + col; + var index = MaxCellCount * row + col; stones[index].SetStone(stoneType); } //스톤상태변경 public void SetStoneState(Enums.StoneState state,int row, int col) { - var index = BoardValue * row + col; + var index = MaxCellCount * row + col; stones[index].SetState(state); } }