@Test public void testGenerateNewlyVisibleObjectMessage() { WorldObject object = mock(WorldObject.class); when(object.getName()).thenReturn("Foo"); when(object.getVector2D()).thenReturn(Vector2D.ORIGIN); Message message = worldServerMessageFactory.generateNewlyVisibleMessage(object); assertEquals(message.name, "ObjectVisibleMessage"); assertEquals(message.getArgument("name"), "Foo"); }
public Message generateNewlyVisibleMessage(WorldObject object) { Message newlyVisibleMessage; if (object instanceof Actor) { newlyVisibleMessage = generateActorVisibleMessage((Actor) object); } else { newlyVisibleMessage = generateObjectVisibleMessage(object); } return newlyVisibleMessage; }
WorldServerMessageFactory extends ServerMessageFactory { public Message generateNewlyVisibleMessage(WorldObject object) { Message newlyVisibleMessage; if (object instanceof Actor) { newlyVisibleMessage = generateActorVisibleMessage((Actor) object); } else { newlyVisibleMessage = generateObjectVisibleMessage(object); } return newlyVisibleMessage; } }
WorldServerMessageFactory extends ServerMessageFactory { public Message generateNewlyVisibleMessage(WorldObject object) { Message newlyVisibleMessage; if (object instanceof Actor) { newlyVisibleMessage = generateActorVisibleMessage((Actor) object); } else { newlyVisibleMessage = generateObjectVisibleMessage(object); } return newlyVisibleMessage; }  }
WorldServerMessageFactory extends ServerMessageFactory { public Message generateNewlyVisibleMessage(WorldObject object) { Message newlyVisibleMessage; if (object instanceof Actor) { newlyVisibleMessage = generateActorVisibleMessage((Actor) object); } else { newlyVisibleMessage = generateObjectVisibleMessage(object); } return newlyVisibleMessage; }  Message generateNewlyVisibleMessage(WorldObject object); List<Message> generateChangeStateMessages(Actor changedActor); Message generateForcedStateMessage(MoveState forcedState); Message generateActorMoveSpeedMessage(double moveSpeed); Message generateNewlyInvisibleMessage(WorldObject object); Message generateWorldLoginResponse(); Message generateWorldFileResponse(byte[] worldFileBytes); Message generateWorldChecksumResponse(byte[] checkSum); }
WorldServerMessageFactory extends ServerMessageFactory { public Message generateNewlyVisibleMessage(WorldObject object) { Message newlyVisibleMessage; if (object instanceof Actor) { newlyVisibleMessage = generateActorVisibleMessage((Actor) object); } else { newlyVisibleMessage = generateObjectVisibleMessage(object); } return newlyVisibleMessage; }  Message generateNewlyVisibleMessage(WorldObject object); List<Message> generateChangeStateMessages(Actor changedActor); Message generateForcedStateMessage(MoveState forcedState); Message generateActorMoveSpeedMessage(double moveSpeed); Message generateNewlyInvisibleMessage(WorldObject object); Message generateWorldLoginResponse(); Message generateWorldFileResponse(byte[] worldFileBytes); Message generateWorldChecksumResponse(byte[] checkSum);  }