Exemple #1
0
 public bool intersects(ContactMap p_other)
 {
     for (int i = 0; i < 8; i++)
     {
         if (m_map[i] && p_other.m_map[i])
             return false;
     }
     return true;
 }
Exemple #2
0
 public bool compare(ContactMap p_other)
 {
     for (int i = 0; i < 8; i++)
     {
         if (m_map[i] != p_other.m_map[i])
             return false;
     }
     return true;
 }
Exemple #3
0
 private ContactMap getContactMap(int p_x, int p_y, Tilemap p_roadMap)
 {
     ContactMap contact = new ContactMap();
     if (p_roadMap.getState(p_x, p_y - 1) >= 0)
         contact.m_map[0] = true;
     if (p_roadMap.getState(p_x + 1, p_y) >= 0)
         contact.m_map[1] = true;
     if (p_roadMap.getState(p_x, p_y + 1) >= 0)
         contact.m_map[2] = true;
     if (p_roadMap.getState(p_x - 1, p_y) >= 0)
         contact.m_map[3] = true;
     return contact;
 }