本文整理匯總了C#中Board.Load方法的典型用法代碼示例。如果您正苦於以下問題:C# Board.Load方法的具體用法?C# Board.Load怎麽用?C# Board.Load使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Board
的用法示例。
在下文中一共展示了Board.Load方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: BoardControl
public BoardControl()
{
InitializeComponent();
SetStyle( ControlStyles.ResizeRedraw |
ControlStyles.UserPaint |
ControlStyles.AllPaintingInWmPaint |
ControlStyles.DoubleBuffer, true );
_board = new Board();
_board.Load( "7#|#5-#|#5-#|#.-#2-#|#.-2$-#|#.2$2-#|#.#[email protected]#|7#" );
UpdateBoard();
}
示例2: Initialize
/// <summary>
/// Allows the game to perform any initialization it needs to before starting to run.
/// This is where it can query for any required services and load any non-graphic
/// related content. Calling base.Initialize will enumerate through any components
/// and initialize them as well.
/// </summary>
protected override void Initialize()
{
IsMouseVisible = true;
Window.Title = "Sokoban";
Window.IsBorderless = true;
_oldState = Keyboard.GetState( );
_board = new Board();
_board.Load( "7#|#5-#|#5-#|#.-#2-#|#.-2$-#|#.2$2-#|#.#[email protected]#|7#" );
base.Initialize();
}
示例3: TestMove
public void TestMove( string boardStr, Move move, bool expectedValid, string expected )
{
var board = new Board();
board.Load( boardStr );
bool valid = board.MakeMove( move );
Assert.AreEqual( expectedValid, valid );
if ( valid )
{
Assert.AreEqual( expected, board.ToString() );
}
else
{
// Make sure it hasn't changed
Assert.AreEqual( boardStr, board.ToString() );
}
}
示例4: TestLoadRunLengthEncodedBoards
public void TestLoadRunLengthEncodedBoards( string rleBoard, string expected )
{
var board = new Board();
board.Load( rleBoard );
Assert.AreEqual( expected, board.ToString() );
}
示例5: TestLoad
public void TestLoad( string boardStr, string expected )
{
var board = new Board();
board.Load( boardStr );
Assert.AreEqual( expected, board.ToString() );
}
示例6: TestConvertToRunLengthEncoded
public void TestConvertToRunLengthEncoded( string boardStr, string rleBoard )
{
var board = new Board();
board.Load( boardStr );
Assert.AreEqual( rleBoard, board.ToRunLengthEncodedString() );
}
示例7: TestCantMoveOnSolvedBoard
public void TestCantMoveOnSolvedBoard( string boardStr, Move move )
{
var board = new Board();
board.Load( boardStr );
Assert.IsFalse( board.MakeMove( move ) );
}
示例8: PlaybackMoves
private static Board PlaybackMoves( string boardStr, Move[] moveList )
{
var board = new Board();
board.Load( boardStr );
foreach ( Move move in moveList )
{
bool valid = board.MakeMove( move );
Assert.IsTrue( valid );
}
return board;
}
示例9: TestSolved
public void TestSolved( string boardStr, bool isSolved )
{
var board = new Board();
board.Load( boardStr );
Assert.AreEqual( isSolved, board.IsSolved() );
}
示例10: TestRowsAndColumns
public void TestRowsAndColumns( string boardStr, int rows, int columns )
{
var board = new Board();
board.Load( boardStr );
Assert.AreEqual( rows, board.Rows, "Incorrect Rows" );
Assert.AreEqual( columns, board.Columns, "Incorrect Columns" );
}