Exemplo n.º 1
0
 public static boolean stateHasChanged(
     int objectType, int objectX, int objectY, int objectHeight) {
   for (StateObject so : stateChanges) {
     if (so.getHeight() != objectHeight) continue;
     if (so.getX() == objectX && so.getY() == objectY && so.getType() == objectType) return true;
   }
   return false;
 }
Exemplo n.º 2
0
 public static boolean isCachedObject(int objectX, int objectY, int objectHeight, int objectId) {
   for (StateObject so : stateChanges) {
     if (so == null) continue;
     if (so.getHeight() != objectHeight) continue;
     if (so.getStatedObject() == objectId && so.getX() == objectX && so.getY() == objectY)
       return true;
   }
   return false;
 }
Exemplo n.º 3
0
 public static StateObject getStateObject(
     int objectX, int objectY, int objectHeight, int objectId) {
   for (StateObject so : stateChanges) {
     if (so == null) continue;
     if (so.getHeight() != objectHeight) continue;
     if (so.getStatedObject() == objectId && so.getX() == objectX && so.getY() == objectY)
       return so;
   }
   return null;
 }
Exemplo n.º 4
0
 public static void removeStateChange(int objectType, int objectX, int objectY, int objectHeight) {
   for (int index = 0; index < stateChanges.size(); index++) {
     StateObject so = stateChanges.get(index);
     if (so == null) continue;
     if ((so.getX() == objectX && so.getY() == objectY && so.getHeight() == objectHeight)
             && so.getType() == objectType
         || so.getStatedObject() == objectType) {
       stateChanges.remove(index);
       break;
     }
   }
 }