Package controller

Class CurrentState

java.lang.Object
controller.CurrentState

public class CurrentState
extends java.lang.Object
CurrentState has methods to change the user interface and update it based on what is happening in the game. To be seen as the main thread of the game, invoked from AntiTowerDefence.java.
  • Constructor Summary

    Constructors 
    Constructor Description
    CurrentState()  
  • Method Summary

    Modifier and Type Method Description
    protected void addTroop​(Troop t)
    addTroop() - Adds troop.
    protected void deleteTroop​(Troop t)
    deleteTroop() - Deletes troop.
    protected void setWin()  
    java.awt.image.BufferedImage toBufferedImage​(java.awt.Image img)
    Converts a given Image into a BufferedImage

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • setWin

      protected void setWin()
    • deleteTroop

      protected void deleteTroop​(Troop t)
      deleteTroop() - Deletes troop.
      Parameters:
      t - - Troop to be deleted.
    • addTroop

      protected void addTroop​(Troop t)
      addTroop() - Adds troop.
      Parameters:
      t - - Troop to be deleted.
    • toBufferedImage

      public java.awt.image.BufferedImage toBufferedImage​(java.awt.Image img)
      Converts a given Image into a BufferedImage
      Parameters:
      img - The Image to be converted
      Returns:
      The converted BufferedImage