GameStateCreateFromStreamT Method

Initializes a new instance of the GameState class from a stream containing puzzles.

Definition

Namespace: ProjectLCore.GameLogic
Assembly: ProjectLCore (in ProjectLCore.dll) Version: 1.0.0+d0f5e2a7a5f4bb0431970f279d2f79d24b15d256
C#
public static GameState CreateFromStream<T>(
	Stream puzzleStream,
	int numInitialTetrominos = 15,
	int numWhitePuzzles = 2147483647,
	int numBlackPuzzles = 2147483647
)
where T : Puzzle

Parameters

puzzleStream  Stream
Stream to read the puzzles from.
numInitialTetrominos  Int32  (Optional)
The number initial tetrominos.
numWhitePuzzles  Int32  (Optional)
The resulting GameState will contain numWhitePuzzles random puzzles from the stream. This number can exceed the number of puzzles in the stream. Should be at least NumPuzzlesInRow.
numBlackPuzzles  Int32  (Optional)
The resulting GameState will contain numBlackPuzzles random puzzles from the stream. This number can exceed the number of puzzles in the stream. Should be at least NumPuzzlesInRow + 1.

Type Parameters

T
The type of the puzzle. Must be a subclass of Puzzle and have a constructor with the signature Puzzle(BinaryImage, Int32, TetrominoShape, Boolean, UInt32)

Return Value

GameState
Initialized GameState.

See Also