Class Block


  • public class Block
    extends Cell
    Cell with collision to Player
    • Constructor Summary

      Constructors 
      Constructor Description
      Block​(int x, int y, Map map, boolean paint)  
      Block​(int x, int y, Map map, java.lang.String partial, boolean paint)  
    • Method Summary

      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      boolean isInBlock​(int x, int y)
      Checks if this Block in this position
      boolean isInBlock​(int x, int y, boolean half)  
      boolean isPartial()  
      void paint​(java.awt.Graphics2D g)  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • imageCell

        private final ImageCell imageCell
      • paint

        private final boolean paint
      • partial

        private final java.lang.String partial
    • Constructor Detail

      • Block

        public Block​(int x,
                     int y,
                     Map map,
                     boolean paint)
      • Block

        public Block​(int x,
                     int y,
                     Map map,
                     java.lang.String partial,
                     boolean paint)
    • Method Detail

      • isInBlock

        public boolean isInBlock​(int x,
                                 int y)
        Checks if this Block in this position
        Parameters:
        x - X position
        y - Y position
        Returns:
        true if Block is in this position
      • isInBlock

        public boolean isInBlock​(int x,
                                 int y,
                                 boolean half)
        Parameters:
        x - X position
        y - Y position
        half - is half-block
        Returns:
        true if Block is upper half-block
      • isPartial

        public boolean isPartial()
      • paint

        public void paint​(java.awt.Graphics2D g)
        Overrides:
        paint in class Cell
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class Cell