Class Blade

java.lang.Object
fr.formiko.usual.Point
fr.formiko.formiko.Blade
All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
BladeGrass, BladeMoss, BladeSand

public abstract class Blade extends fr.formiko.usual.Point implements Serializable
Vegetal blade is used to represent grass & moss on map.
Author:
Hydrolien
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private double
     
    private static final int
     
    private byte
     
    private static Random
     

    Fields inherited from class fr.formiko.usual.Point

    x, y
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Blade(int len)
    Main contructor with random direction & random location.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    draw(Graphics g, int xOffset, int yOffset)
    Main function that draw this on g.
    (package private) abstract Color
     
    static int
     
    byte
     
    static Blade
    newBlade(byte type)
    Return a new Blade of given type.
    void
    setLength(byte l)
     

    Methods inherited from class fr.formiko.usual.Point

    addX, addY, clone, equals, equals, getX, getY, setX, setY, toString

    Methods inherited from class java.lang.Object

    finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • angle

      private double angle
    • length

      private byte length
    • rand

      private static Random rand
    • avoidBorder

      private static final int avoidBorder
      See Also:
  • Constructor Details

    • Blade

      protected Blade(int len)
      Main contructor with random direction & random location.
  • Method Details

    • newBlade

      public static Blade newBlade(byte type)
      Return a new Blade of given type.
    • length

      public byte length()
    • setLength

      public void setLength(byte l)
    • getColor

      abstract Color getColor()
    • getThikness

      public static int getThikness()
    • draw

      public void draw(Graphics g, int xOffset, int yOffset)
      Main function that draw this on g.
      Parameters:
      g - Graphics where to draw
      xOffset - Case offset in x
      yOffset - Case offset in y