Example #1
0
 protected SokobanState(int[,] initMatrix, int personX, int personY)
 {
     matrix = initMatrix;
     movementSet = new HashSet<SokobanMovement>();
     person = new SokobanPoint(personX, personY);
     CalculateMovement();
 }
Example #2
0
 public SokobanState(int[,] initMatrix)
 {
     matrix = initMatrix;
     movementSet = new HashSet<SokobanMovement>();
     int xCount = matrix.GetLength(0);
     int yCount = matrix.GetLength(1);
     for(int x = 0; x < xCount; x++)
     {
         for (int y = 0; y < yCount; y++)
         {
             if ((matrix[x, y] & PERSON) == PERSON)
             {
                 person = new SokobanPoint(x, y);
             }
         }
     }
     if (person != null)
     {
         CalculateMovement();
     }
 }
Example #3
0
 public SokobanMovement(int x, int y, Direction direction)
 {
     this.point = new SokobanPoint(x, y);
     this.direction = direction;
 }