Package utilities

Class MockScreen

java.lang.Object
utilities.MockScreen
All Implemented Interfaces:
IGameScreen

public class MockScreen extends Object implements IGameScreen
  • Constructor Details

    • MockScreen

      public MockScreen()
  • Method Details

    • center

      public void center()
      Description copied from interface: IGameScreen
      Center the view.
      Specified by:
      center in interface IGameScreen
    • clearTexts

      public void clearTexts()
      Description copied from interface: IGameScreen
      Removes all the text entities.
      Specified by:
      clearTexts in interface IGameScreen
    • convertScreenViewToWorld

      public Point2D convertScreenViewToWorld(Point p)
      Description copied from interface: IGameScreen
      Convert screen view coordinates to world coordinates.
      Specified by:
      convertScreenViewToWorld in interface IGameScreen
      Parameters:
      p - The screen view coordinates.
      Returns:
      World coordinates.
    • convertScreenViewToWorld

      public Point2D convertScreenViewToWorld(int x, int y)
      Description copied from interface: IGameScreen
      Convert screen view coordinates to world coordinates.
      Specified by:
      convertScreenViewToWorld in interface IGameScreen
      Parameters:
      x - The screen view X coordinate.
      y - The screen view Y coordinate.
      Returns:
      World coordinates.
    • getTextAt

      public RemovableSprite getTextAt(int x, int y)
      Description copied from interface: IGameScreen
      Get the text bubble at specific coordinates.
      Specified by:
      getTextAt in interface IGameScreen
      Parameters:
      x - Screen X coordinate.
      y - Screen Y world coordinate.
      Returns:
      the text bubble at the given coordinate or null if not found.
    • nextFrame

      public void nextFrame()
      Description copied from interface: IGameScreen
      Prepare screen for the next frame to be rendered and move it if needed .
      Specified by:
      nextFrame in interface IGameScreen
    • positionChanged

      public void positionChanged(double x, double y)
      Description copied from interface: IGameScreen
      The user position changed. This sets the target coordinates that the screen centers on.
      Specified by:
      positionChanged in interface IGameScreen
      Parameters:
      x - The X coordinate (in world units).
      y - The Y coordinate (in world units).
    • removeText

      public void removeText(RemovableSprite entity)
      Description copied from interface: IGameScreen
      Removes a text bubble.
      Specified by:
      removeText in interface IGameScreen
      Parameters:
      entity - The text to be removed.
    • setOffline

      public void setOffline(boolean offline)
      Description copied from interface: IGameScreen
      Set the offline indication state.
      Specified by:
      setOffline in interface IGameScreen
      Parameters:
      offline - true if offline.
    • getEntityViewAt

      public EntityView<?> getEntityViewAt(double x, double y)
      Description copied from interface: IGameScreen
      Gets an entity view at given coordinates.
      Specified by:
      getEntityViewAt in interface IGameScreen
      Parameters:
      x - The X world coordinate.
      y - The Y world coordinate.
      Returns:
      The entity view, or null if none found.
    • getMovableEntityViewAt

      public EntityView<?> getMovableEntityViewAt(double x, double y)
      Description copied from interface: IGameScreen
      Get a movable entity view at given coordinates.
      Specified by:
      getMovableEntityViewAt in interface IGameScreen
      Parameters:
      x - The X world coordinate.
      y - The Y world coordinate.
      Returns:
      The entity view, or null if none found.