Пример #1
0
 public ArrayListGameObject childrenRecursive() {
   ArrayListGameObject childList = new ArrayListGameObject();
   for (GameObject child : children) {
     childList.add(child);
     childList.addAll(child.childrenRecursive());
   }
   return childList;
 }
Пример #2
0
 public boolean hit() {
   for (GameObject g : touchingObjects) {
     if (!touchingObjectsLast.contains(g)) {
       return true;
     }
   }
   return false;
 }
Пример #3
0
 public boolean hitComponent(String compName) {
   for (GameObject g : touchingObjects) {
     if (g.components.get(compName) != null && !touchingObjectsLast.contains(g)) return true;
   }
   return false;
 }
Пример #4
0
 public boolean hitProperty(String propName) {
   for (GameObject g : touchingObjects) {
     if (g.props.containsKey(propName) && !touchingObjectsLast.contains(g)) return true;
   }
   return false;
 }
Пример #5
0
 public boolean hit(String name) {
   for (GameObject g : touchingObjects) {
     if (g.name().equals(name) && !touchingObjectsLast.contains(g)) return true;
   }
   return false;
 }
Пример #6
0
 public boolean touchingComponent(String compName) {
   return touchingObjects.getByComponent(compName) != null;
 }
Пример #7
0
 public boolean touchingProperty(String propName) {
   return touchingObjects.getByProperty(propName) != null;
 }
Пример #8
0
 public boolean touching(String name) {
   return touchingObjects.get(name) != null;
 }
Пример #9
0
 public boolean touching() {
   return !touchingObjects.isEmpty();
 }