public void AddChecker(Checker checker) { switch (checker.Color) { case CheckerColor.Black: BlackCheckers.Add(checker); break; case CheckerColor.White: WhiteCheckers.Add(checker); break; } }
void CreateCheckerRow(int y, bool isWhite) { int beginCell = y % 2 == 0 ? 2 : 1; for (int x = beginCell; x <= beginCell + 6; x += 2) { var createdChecker = Instantiate(_checkerPrefab, CheckerToWorldCoords(y, x), Quaternion.identity, transform); var checkerCoords = new CheckerCoords(y, x); createdChecker.Init(this, checkerCoords, isWhite); if (isWhite) { WhiteCheckers.Add(createdChecker); } else { BlackCheckers.Add(createdChecker); } _allCheckers.Add(checkerCoords, createdChecker); } }
public void AddWhiteCheckerToBar(Checker checker) { WhiteCheckers.Add(checker); }