package de.bitbrain.braingdx.world;

import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.math.Rectangle;
import de.bitbrain.braingdx.world.GameWorld.WorldBounds;

public class SimpleWorldBounds implements WorldBounds {

   private final float width, height;

   private final Rectangle rect, target;

   public SimpleWorldBounds(float width, float height) {
      this.width = width;
      this.height = height;
      this.rect = new Rectangle();
      this.rect.width = width;
      this.rect.height = height;
      this.target = new Rectangle();
   }

   @Override
   public boolean isInBounds(GameObject object, OrthographicCamera camera) {
      target.x = object.getLeft();
      target.y = object.getTop();
      target.width = object.getWidth();
      target.height = object.getHeight();
      return rect.contains(target) || target.overlaps(target);
   }

   @Override
   public float getWorldWidth() {
      return width;
   }

   @Override
   public float getWorldHeight() {
      return height;
   }

   @Override
   public float getWorldOffsetX() {
      return 0;
   }

   @Override
   public float getWorldOffsetY() {
      return 0;
   }

}

@@ -34,61 +34,8 @@
 d;%0A%0A
-import com.badlogic.gdx.graphics.OrthographicCamera;%0A
 impo
@@ -582,35 +582,8 @@
 ject
-, OrthographicCamera camera
 ) %7B%0A
@@ -771,21 +771,19 @@
 get) %7C%7C 
-targe
+rec
 t.overla

fix SimpleWorldBounds collision