Package math.wfc

Class Tile

java.lang.Object
math.wfc.Tile

public class Tile extends Object
A Class to store data about a Tile.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Tile(int id)
    Default Constructer that initializes a Tile without rules.
    Tile(int id, Rule[] rules)
    Constructer that takes a list of rules for the given Tile.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Getter Function for the id of the tile.
    getState(Gridstate grid, int x, int y)
    Function to see if all Rules for this tile are fullfilles at a certain position

    Methods inherited from class java.lang.Object

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

    • Tile

      public Tile(int id)
      Default Constructer that initializes a Tile without rules.
      Parameters:
      id - the id of the Tile
    • Tile

      public Tile(int id, Rule[] rules)
      Constructer that takes a list of rules for the given Tile.
      Parameters:
      id - the id of the Tile
      rules - the rules to add to the Tile
  • Method Details

    • getState

      public Rule.STATE getState(Gridstate grid, int x, int y)
      Function to see if all Rules for this tile are fullfilles at a certain position
      Parameters:
      grid - current gridstate
      x - x-coordinate of Superposition
      y - y-coordinate of Superposition
      Returns:
      Rule.STATE object with result of all included rules
    • getId

      public int getId()
      Getter Function for the id of the tile.
      Returns:
      id of the tile that was set in the Constructor