Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /// Summary: Parses the look-reply
- private boolean p_ParseLookReply(ArrayList<String> lines)
- {
- // Find out what the first position is :)
- int numrows = lines.size();
- String[] larr = new String[numrows];
- lines.toArray(larr);
- assert(numrows % 2 == 1);
- // we always expect an odd number of rows
- int rowRadius = (numrows - 1) / 2;
- m_LookRadius = rowRadius;
- for (int row = -rowRadius; row <= rowRadius; row++)
- {
- for (int col = -rowRadius; col <= rowRadius; col++)
- {
- String curChar = larr[row + rowRadius].charAt(col + rowRadius) + "";
- if (curChar.equals("X"))
- continue; // retards not included! lol
- m_Map.add(col + m_curX, row + m_curY, curChar);
- }
- }
- System.out.println("----- LOOK REPLY -----");
- System.out.println(m_Map);
- // If this is our turn, this is where we should be moving...
- if (m_OurTurn == true)
- {
- System.out.println("----- trying to move... -----");
- boolean retVal = p_Act_CompleteMove();
- System.out.println("-----------------------------");
- return retVal;
- }
- return true;
- }
Add Comment
Please, Sign In to add comment