Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void checkIfLegal(){
- if (square[2][0] == 19 || square[3][0] == 19) {
- foreach (List<int> sq in square) {
- GameBoard.notLegal.Add(Tuple.Create(sq[0], sq[1]));
- }
- if (GameBoard.notLegal.Any()){
- foreach (Tuple<int, int> pos in GameBoard.notLegal) {
- if ((square [2] [0] == pos.Item1 && square[2][1] == pos.Item2) || (square [3] [0] == pos.Item1) && square[3][1] == pos.Item2) {
- temp.Add (Tuple.Create (square [0] [0], square [0] [1]));
- temp.Add (Tuple.Create (square [1] [0], square [1] [1]));
- temp.Add (Tuple.Create (square [2] [0], square [2] [1]));
- temp.Add (Tuple.Create (square [3] [0], square [3] [1]));
- }
- }
- }
- GameBoard.notLegal.Union (temp);
- temp.Clear ();
- Reset();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement