Class ColourDirective

java.lang.Object
application.model.rules.ruleloader.Directive
application.model.rules.ruleloader.ColourDirective
All Implemented Interfaces:
Exportable

public class ColourDirective
extends Directive
implements Exportable
Implements the @COLORS / @COLOURS directive in ruletables.

Example:
 \@COLORS
 0 0 0 0
 1 255 255 0
 2 0 255 255
 3 255 0 255
 
  • Field Summary

    Fields inherited from class application.model.rules.ruleloader.Directive

    directiveName
  • Constructor Summary

    Constructors 
    Constructor Description
    ColourDirective​(java.lang.String content)  
  • Method Summary

    Modifier and Type Method Description
    java.lang.Object clone()
    Deep copies the directive
    java.lang.String export()
    Exports the directive to Golly / Lifelib
    javafx.scene.paint.Color getColour​(int state)
    Gets the colour of a given state of the cell
    void parseContent​(java.lang.String content)
    Parses the content of the directive

    Methods inherited from class application.model.rules.ruleloader.Directive

    getDirectiveName

    Methods inherited from class java.lang.Object

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

  • Method Details

    • parseContent

      public void parseContent​(java.lang.String content)
      Description copied from class: Directive
      Parses the content of the directive
      Specified by:
      parseContent in class Directive
      Parameters:
      content - The content of the directive
    • getColour

      public javafx.scene.paint.Color getColour​(int state)
      Gets the colour of a given state of the cell
      Parameters:
      state - The state of the cell
      Returns:
      Returns the colour of the cell
    • clone

      public java.lang.Object clone()
      Description copied from class: Directive
      Deep copies the directive
      Specified by:
      clone in class Directive
      Returns:
      Return a deepcopy of the directive
    • export

      public java.lang.String export()
      Description copied from interface: Exportable
      Exports the directive to Golly / Lifelib
      Specified by:
      export in interface Exportable
      Returns:
      The exported directive to be parsed by Golly or Lifelib