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:
Example:
\@COLORS 0 0 0 0 1 255 255 0 2 0 255 255 3 255 0 255
-
Field Summary
-
Constructor Summary
Constructors Constructor Description ColourDirective(java.lang.String content) -
Method Summary
Modifier and Type Method Description java.lang.Objectclone()Deep copies the directivejava.lang.Stringexport()Exports the directive to Golly / Lifelibjavafx.scene.paint.ColorgetColour(int state)Gets the colour of a given state of the cellvoidparseContent(java.lang.String content)Parses the content of the directive
-
Constructor Details
-
ColourDirective
public ColourDirective(java.lang.String content)
-
-
Method Details
-
parseContent
public void parseContent(java.lang.String content)Description copied from class:DirectiveParses the content of the directive- Specified by:
parseContentin classDirective- 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:DirectiveDeep copies the directive -
export
public java.lang.String export()Description copied from interface:ExportableExports the directive to Golly / Lifelib- Specified by:
exportin interfaceExportable- Returns:
- The exported directive to be parsed by Golly or Lifelib
-