Advertisement
Guest User

Untitled

a guest
Nov 27th, 2014
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.66 KB | None | 0 0
  1. public Piece GetEmptyPiece()
  2.         {
  3.             for (int i = 0; i < pieces.Count; i++)
  4.             {
  5.                 if (pieces[i].IsEmpty == true)
  6.                 {
  7.                     return pieces[i];
  8.                 }
  9.             }
  10.             return null;
  11.         }
  12.  
  13. public Piece GetPiece(int[] currPos)
  14.         {
  15.             for (int i = 0; i < pieces.Count; i++)
  16.             {
  17.                 int[] pieceICurrPos = pieces[i].CurrPos;
  18.                 if ((pieceICurrPos[0] == currPos[0]) && (pieceICurrPos[1] == currPos[1]))
  19.                 {
  20.                     return pieces[i];
  21.                 }
  22.             }
  23.             return null;
  24.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement