Table of Contents

Class ColorPuzzle

Namespace
ProjectLCore.GamePieces
Assembly
Assembly-CSharp.dll

Represents a puzzle in the game.

public class ColorPuzzle : Puzzle
Inheritance
Puzzle
ColorPuzzle
Inherited Members
Puzzle._usedTetrominos
Puzzle.CanPlaceTetromino(BinaryImage)
Puzzle.GetUsedTetrominos()
Puzzle.PuzzleNumber
Puzzle.Id
Puzzle.IsBlack
Puzzle.RewardScore
Puzzle.RewardTetromino
Puzzle.Image
Puzzle.NumEmptyCells
Puzzle.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 BinaryImage

The binary image representing the puzzle.

rewardScore int

The score the player will receive for completing the puzzle.

rewardTetromino TetrominoShape

The tetromino the player will receive for completing the puzzle.

isBlack bool

Indicates whether the puzzle is black or white

puzzleNumber uint

The order number of this puzzle. The file containing the graphics for this puzzle should have the name color-number.png where color is black or white and number is puzzleNumber.

Properties

ColorImage

A ColorImage representing the puzzle. Specifies the color of each cell in the puzzle.

public ColorImage ColorImage { get; }

Property Value

ColorImage

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 TetrominoShape

The shape of the tetromino.

position BinaryImage

The 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 TetrominoShape
position BinaryImage

TryGetSprite(out Sprite?)

public bool TryGetSprite(out Sprite? sprite)

Parameters

sprite Sprite

Returns

bool