public void ClearBoard() { _graphicsBoard.ClearBoard(); //i think. _gameContainer.PlayerList !.ForEach(thisPlayer => { thisPlayer.CurrentPieceList.Clear(); var firstList = GameBoardGraphicsCP.GetBlackStartingSpaces(); firstList.ForEach(thisIndex => { var thisSpace = new PlayerSpace(); thisSpace.Index = thisIndex; thisSpace.IsCrowned = false; thisPlayer.CurrentPieceList.Add(thisSpace); }); }); }
public void ClearBoard() { _graphicsBoard.ClearBoard(); //i think. _gameContainer.PlayerList !.ForEach(thisPlayer => { thisPlayer.CurrentPieceList.Clear(); int x; int thisIndex; thisPlayer.CurrentPieceList = new CustomBasicList <PlayerSpace>(); PlayerSpace thisPiece; for (x = 1; x <= 8; x++) { thisIndex = GetIndex(7, x); thisPiece = new PlayerSpace(); { var withBlock = thisPiece; withBlock.Index = thisIndex; withBlock.Piece = EnumPieceType.PAWN; } thisPlayer.CurrentPieceList.Add(thisPiece); } thisIndex = GetIndex(8, 1); thisPiece = new PlayerSpace(); thisPiece.Index = thisIndex; thisPiece.Piece = EnumPieceType.ROOK; thisPlayer.CurrentPieceList.Add(thisPiece); thisIndex = GetIndex(8, 8); thisPiece = new PlayerSpace(); thisPiece.Piece = EnumPieceType.ROOK; thisPiece.Index = thisIndex; thisPlayer.CurrentPieceList.Add(thisPiece); thisIndex = GetIndex(8, 2); thisPiece = new PlayerSpace(); thisPiece.Index = thisIndex; thisPiece.Piece = EnumPieceType.KNIGHT; thisPlayer.CurrentPieceList.Add(thisPiece); thisIndex = GetIndex(8, 7); thisPiece = new PlayerSpace(); thisPiece.Index = thisIndex; thisPiece.Piece = EnumPieceType.KNIGHT; thisPlayer.CurrentPieceList.Add(thisPiece); thisIndex = GetIndex(8, 3); thisPiece = new PlayerSpace(); thisPiece.Index = thisIndex; thisPiece.Piece = EnumPieceType.BISHOP; thisPlayer.CurrentPieceList.Add(thisPiece); thisIndex = GetIndex(8, 6); thisPiece = new PlayerSpace(); thisPiece.Piece = EnumPieceType.BISHOP; thisPiece.Index = thisIndex; thisPlayer.CurrentPieceList.Add(thisPiece); thisIndex = GetIndex(8, 4); thisPiece = new PlayerSpace(); thisPiece.Index = thisIndex; thisPiece.Piece = EnumPieceType.QUEEN; thisPlayer.CurrentPieceList.Add(thisPiece); thisIndex = GetIndex(8, 5); thisPiece = new PlayerSpace(); thisPiece.Index = thisIndex; thisPiece.Piece = EnumPieceType.KING; thisPlayer.CurrentPieceList.Add(thisPiece); }); }
// Use this for initialization void Start() { PS = gameObject.GetComponent<PlayerSpace>(); }