## Uses of Class
edu.wisc.game.sql.Piece.Color

- Packages that use Piece.Color
  Package | Description
  --- | ---
  edu.wisc.game.engine | Top-level Game Server code
  edu.wisc.game.rest | The RESTful web API
  edu.wisc.game.sql | Persistent data structures

- - ### Uses of Piece.Color in edu.wisc.game.engine

    Fields in edu.wisc.game.engine declared as Piece.Color
    Modifier and Type | Field | Description
    --- | --- | ---
    `Piece.Color[]` | RuleSet.Atom.`colors` | For shape-and-color pieces, determines acceptable colors.

    Methods in edu.wisc.game.engine that return types with arguments of type Piece.Color
    Modifier and Type | Method | Description
    --- | --- | ---
    `HashSet<Piece.Color>` | RuleSet.`listAllColors()` | Lists all colors used in this rule set.

    Methods in edu.wisc.game.engine with parameters of type Piece.Color
    Modifier and Type | Method | Description
    --- | --- | ---
    `Board` | StalemateTester.`canStalemate​(Piece.Shape[] shapes, Piece.Color[] colors, String[] allImages)` | Is there any board composed of any pieces of the specified colors and shapes on which this rule set will stalemate? As always, we assume that all atoms in the rules are "non-disappearing", i.e.

  - ### Uses of Piece.Color in edu.wisc.game.rest

    Fields in edu.wisc.game.rest declared as Piece.Color
    Modifier and Type | Field | Description
    --- | --- | ---
    `Piece.Color[]` | ParaSet.`colors` |

    Methods in edu.wisc.game.rest that return Piece.Color
    Modifier and Type | Method | Description
    --- | --- | ---
    `static Piece.Color[]` | ParaSet.`parseColors​(String val)` |

    Methods in edu.wisc.game.rest with parameters of type Piece.Color
    Modifier and Type | Method | Description
    --- | --- | ---
    `String` | ColorMap.`getHex​(Piece.Color color, boolean brighten)` |
    `boolean` | ColorMap.`hasColor​(Piece.Color color)` |

  - ### Uses of Piece.Color in edu.wisc.game.sql

    Fields in edu.wisc.game.sql declared as Piece.Color
    Modifier and Type | Field | Description
    --- | --- | ---
    `static Piece.Color` | Piece.Color.`BLACK` |
    `static Piece.Color` | Piece.Color.`BLUE` |
    `static Piece.Color[]` | Piece.Color.`legacyColors` | The four original colors, inherited from Game Engine 1.0, and used for compatibility with old trial list files.
    `static Piece.Color` | Piece.Color.`RED` |
    `static Piece.Color` | Piece.Color.`YELLOW` |

    Methods in edu.wisc.game.sql that return Piece.Color
    Modifier and Type | Method | Description
    --- | --- | ---
    `static Piece.Color` | Piece.Color.`findColor​(String s)` |
    `static Piece.Color[]` | Piece.Color.`findColors​(String[] v)` |
    `Piece.Color` | Piece.`xgetColor()` |

    Methods in edu.wisc.game.sql with parameters of type Piece.Color
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | Piece.`setColor​(Piece.Color x)` | This is how it used by our JsonToJava, when reading board files

    Constructors in edu.wisc.game.sql with parameters of type Piece.Color
    Constructor | Description
    --- | ---
    `Board​(RandomRG random, edu.wisc.game.sql.PositionMask positionMask, int randomCnt, int nShapes, int nColors, Piece.Shape[] allShapes, Piece.Color[] allColors, boolean crowded)` | The main constructor for a random initial board in GS 2.*.
    `Game​(RandomRG _random, RuleSet _rules, int _randomObjCnt, int _nShapes, int _nColors, Piece.Shape[] _allShapes, Piece.Color[] _allColors)` | A game with shape-and-color objects used as game pieces
    `Game​(RandomRG _random, RuleSet _rules, int _randomObjCnt, Piece.Shape[] _allShapes, Piece.Color[] _allColors)` |
    `Piece​(Piece.Shape _shape, Piece.Color _color, int _x, int _y)` | Creates a traditional (shape+color) game piece placed at a specified location.
    `RandomGameGenerator​(RandomRG _random, File ruleSetFile, int[] _nPiecesRange, int[] _nShapesRange, int[] _nColorsRange, Piece.Shape[] _allShapes, Piece.Color[] _allColors)` |