Guest User

Untitled

a guest
Apr 25th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. /// Summary: Parses the look-reply
  2. private boolean p_ParseLookReply(ArrayList<String> lines)
  3. {
  4. // Find out what the first position is :)
  5. int numrows = lines.size();
  6.  
  7. String[] larr = new String[numrows];
  8. lines.toArray(larr);
  9.  
  10. assert(numrows % 2 == 1);
  11.  
  12. // we always expect an odd number of rows
  13. int rowRadius = (numrows - 1) / 2;
  14. m_LookRadius = rowRadius;
  15.  
  16.  
  17.  
  18. for (int row = -rowRadius; row <= rowRadius; row++)
  19. {
  20. for (int col = -rowRadius; col <= rowRadius; col++)
  21. {
  22. String curChar = larr[row + rowRadius].charAt(col + rowRadius) + "";
  23.  
  24. if (curChar.equals("X"))
  25. continue; // retards not included! lol
  26.  
  27. m_Map.add(col + m_curX, row + m_curY, curChar);
  28. }
  29. }
  30.  
  31. System.out.println("----- LOOK REPLY -----");
  32. System.out.println(m_Map);
  33.  
  34.  
  35. // If this is our turn, this is where we should be moving...
  36. if (m_OurTurn == true)
  37. {
  38. System.out.println("----- trying to move... -----");
  39. boolean retVal = p_Act_CompleteMove();
  40. System.out.println("-----------------------------");
  41. return retVal;
  42. }
  43.  
  44.  
  45. return true;
  46. }
Add Comment
Please, Sign In to add comment