*/
@Test
public void testCollidesEntity() throws Exception {
final CollisionMap map = new CollisionMap(4, 4);
map.set(1, 1);
Player bob = new Player();
PlayerTestHelper.generatePlayerRPClasses();
StendhalRPRuleProcessor.get();
MockStendlRPWorld.get();
games.stendhal.server.entity.player.Player serverbob = games.stendhal.server.entity.player.Player
.createZeroLevelPlayer("bob", null);
serverbob.setPosition(0, 0);
bob.initialize(serverbob);
assertThat(bob.getWidth(), is(1.0));
assertThat(bob.getWidth(), is(1.0));
assertThat(bob.getX(), is(0.0));
assertThat(bob.getY(), is(0.0));
assertFalse(map.collides((int) bob.getX(), (int) bob.getY(), (int) bob
.getWidth(), (int) bob.getHeight()));
serverbob.setPosition(0, 1);
bob.initialize(serverbob);
assertThat(bob.getX(), is(0.0));
assertThat(bob.getY(), is(1.0));
assertFalse(map.collides((int) bob.getX(), (int) bob.getY(), (int) bob
.getWidth(), (int) bob.getHeight()));
serverbob.setPosition(0, 2);
bob.initialize(serverbob);
assertFalse(map.collides((int) bob.getX(), (int) bob.getY(), (int) bob
.getWidth(), (int) bob.getHeight()));
serverbob.setPosition(0, 3);
bob.initialize(serverbob);
assertFalse(map.collides((int) bob.getX(), (int) bob.getY(), (int) bob
.getWidth(), (int) bob.getHeight()));
serverbob.setPosition(1, 0);
bob.initialize(serverbob);
assertFalse(map.collides((int) bob.getX(), (int) bob.getY(), (int) bob
.getWidth(), (int) bob.getHeight()));
serverbob.setPosition(1, 1);
bob.initialize(serverbob);
assertTrue(map.collides((int) bob.getX(), (int) bob.getY(), (int) bob
.getWidth(), (int) bob.getHeight()));
serverbob.setPosition(1, 2);
bob.initialize(serverbob);
assertFalse(map.collides((int) bob.getX(), (int) bob.getY(), (int) bob
.getWidth(), (int) bob.getHeight()));
serverbob.setPosition(1, 3);
bob.initialize(serverbob);
assertFalse(map.collides((int) bob.getX(), (int) bob.getY(), (int) bob
.getWidth(), (int) bob.getHeight()));
serverbob.setPosition(2, 0);
bob.initialize(serverbob);
assertFalse(map.collides((int) bob.getX(), (int) bob.getY(), (int) bob
.getWidth(), (int) bob.getHeight()));
serverbob.setPosition(2, 1);
bob.initialize(serverbob);
assertFalse(map.collides((int) bob.getX(), (int) bob.getY(), (int) bob
.getWidth(), (int) bob.getHeight()));
serverbob.setPosition(2, 2);
bob.initialize(serverbob);
assertFalse(map.collides((int) bob.getX(), (int) bob.getY(), (int) bob
.getWidth(), (int) bob.getHeight()));
serverbob.setPosition(2, 3);
bob.initialize(serverbob);
assertFalse(map.collides((int) bob.getX(), (int) bob.getY(), (int) bob
.getWidth(), (int) bob.getHeight()));
serverbob.setPosition(3, 0);
bob.initialize(serverbob);
assertFalse(map.collides((int) bob.getX(), (int) bob.getY(), (int) bob
.getWidth(), (int) bob.getHeight()));
serverbob.setPosition(3, 1);
bob.initialize(serverbob);
assertFalse(map.collides((int) bob.getX(), (int) bob.getY(), (int) bob
.getWidth(), (int) bob.getHeight()));
serverbob.setPosition(3, 2);
bob.initialize(serverbob);
assertFalse(map.collides((int) bob.getX(), (int) bob.getY(), (int) bob
.getWidth(), (int) bob.getHeight()));
serverbob.setPosition(3, 3);
bob.initialize(serverbob);
assertFalse(map.collides((int) bob.getX(), (int) bob.getY(), (int) bob
.getWidth(), (int) bob.getHeight()));
}