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.Object
clone()
Deep copies the directivejava.lang.String
export()
Exports the directive to Golly / Lifelibjavafx.scene.paint.Color
getColour(int state)
Gets the colour of a given state of the cellvoid
parseContent(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:Directive
Parses the content of the directive- Specified by:
parseContent
in 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:Directive
Deep copies the directive -
export
public java.lang.String export()Description copied from interface:Exportable
Exports the directive to Golly / Lifelib- Specified by:
export
in interfaceExportable
- Returns:
- The exported directive to be parsed by Golly or Lifelib
-