Class ColorPuzzle
- Namespace
- ProjectLCore.GamePieces
- Assembly
- Assembly-CSharp.dll
Represents a puzzle in the game.
public class ColorPuzzle : Puzzle
- Inheritance
-
PuzzleColorPuzzle
- Inherited Members
-
Puzzle._usedTetrominosPuzzle.CanPlaceTetromino(BinaryImage)Puzzle.GetUsedTetrominos()Puzzle.PuzzleNumberPuzzle.IdPuzzle.IsBlackPuzzle.RewardScorePuzzle.RewardTetrominoPuzzle.ImagePuzzle.NumEmptyCellsPuzzle.IsFinished
Constructors
ColorPuzzle(BinaryImage, int, TetrominoShape, bool, uint)
Initializes a new instance of the ColorPuzzle class.
public ColorPuzzle(BinaryImage image, int rewardScore, TetrominoShape rewardTetromino, bool isBlack, uint puzzleNumber)
Parameters
image
BinaryImageThe binary image representing the puzzle.
rewardScore
intThe score the player will receive for completing the puzzle.
rewardTetromino
TetrominoShapeThe tetromino the player will receive for completing the puzzle.
isBlack
boolIndicates whether the puzzle is black or white
puzzleNumber
uintThe order number of this puzzle. The file containing the graphics for this puzzle should have the name
color-number.png
where color isblack
orwhite
and number ispuzzleNumber
.
Properties
ColorImage
A ColorImage representing the puzzle. Specifies the color of each cell in the puzzle.
public ColorImage ColorImage { get; }
Property Value
Methods
AddListener(IColorPuzzleListener)
public void AddListener(IColorPuzzleListener listener)
Parameters
listener
IColorPuzzleListener
AddTetromino(TetrominoShape, BinaryImage)
Places the given tetromino into the puzzle.
public override void AddTetromino(TetrominoShape tetromino, BinaryImage position)
Parameters
tetromino
TetrominoShapeThe shape of the tetromino.
position
BinaryImageThe position of the tetromino.
Clone()
Clones this instance.
public override Puzzle Clone()
Returns
- Puzzle
A deep copy of this instance.
RemoveListener(IColorPuzzleListener)
public void RemoveListener(IColorPuzzleListener listener)
Parameters
listener
IColorPuzzleListener
RemoveTetromino(TetrominoShape, BinaryImage)
public override void RemoveTetromino(TetrominoShape tetromino, BinaryImage position)
Parameters
tetromino
TetrominoShapeposition
BinaryImage
TryGetSprite(out Sprite?)
public bool TryGetSprite(out Sprite? sprite)
Parameters
sprite
Sprite