Advertisement
Guest User

Untitled

a guest
Nov 29th, 2018
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class Cell {
  6. int i,j;
  7. bool []walls = new bool [4];// top , right , bottom , left
  8. bool Isvisited;
  9. public Cell(int x , int y)
  10. {
  11. this.i = x;
  12. this.j = y;
  13. Isvisited = false;
  14. for (int i = 0; i < 4; i++)
  15. walls[i] = true;
  16. }
  17.  
  18. public void SetVisited(bool temp){
  19. Isvisited = temp;
  20. }
  21. public void SetTop(bool temp){
  22. walls[0] = temp;
  23. }
  24. public void SetRight(bool temp){
  25. walls[1] = temp;
  26. }
  27. public void SetBottom(bool temp){
  28. walls[2] = temp;
  29. }
  30. public void SetLeft(bool temp){
  31. walls[3] = temp;
  32. }
  33. public int Get_i(){
  34. return i;
  35. }
  36. public int Get_j(){
  37. return j;
  38. }
  39. public bool GetTop(){
  40. return walls[0];
  41. }
  42. public bool GetRight(){
  43. return walls[1];
  44. }
  45. public bool GetBottom(){
  46. return walls[2];
  47. }
  48. public bool GetLeft(){
  49. return walls[3];
  50. }
  51. public bool GetVisited(){
  52. return Isvisited;
  53. }
  54.  
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement