Class DefaultCore

java.lang.Object
sac.model.gamemodes.DefaultCore
All Implemented Interfaces:
GameCore

public class DefaultCore extends Object implements GameCore
The default game core used by classic Tetris game mode.
  • Constructor Details

    • DefaultCore

      public DefaultCore()
  • Method Details

    • getPieceGenerator

      public Generator getPieceGenerator()
      Specified by:
      getPieceGenerator in interface GameCore
      Returns:
      the pieceGenerator this game would use
    • getRotationSystem

      public RotationSystem getRotationSystem()
      Specified by:
      getRotationSystem in interface GameCore
      Returns:
      the rotationSystem this game would use
    • getSpawnPosition

      public Point getSpawnPosition(Piece piece)
      Spawn the piece in the middle of the board.
      Specified by:
      getSpawnPosition in interface GameCore
      Parameters:
      piece - - current piece spawned
      Returns:
      the spawn position
    • getWidth

      public int getWidth()
      Specified by:
      getWidth in interface GameCore
      Returns:
      width of the board
    • getHeight

      public int getHeight()
      Specified by:
      getHeight in interface GameCore
      Returns:
      height of the board (buffer included)
    • getBuffer

      public int getBuffer()
      Specified by:
      getBuffer in interface GameCore
      Returns:
      height of the buffer zone of the board