當前位置: 首頁>>代碼示例>>C#>>正文


C# Board.Load方法代碼示例

本文整理匯總了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();
 }
開發者ID:rprouse,項目名稱:SokobanCSharp,代碼行數:11,代碼來源:BoardControl.cs

示例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();
        }
開發者ID:rprouse,項目名稱:SokobanCSharp,代碼行數:19,代碼來源:SokobanGame.cs

示例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() );
      }
 }
開發者ID:rprouse,項目名稱:SokobanCSharp,代碼行數:16,代碼來源:BoardTest.cs

示例4: TestLoadRunLengthEncodedBoards

 public void TestLoadRunLengthEncodedBoards( string rleBoard, string expected )
 {
     var board = new Board();
      board.Load( rleBoard );
      Assert.AreEqual( expected, board.ToString() );
 }
開發者ID:rprouse,項目名稱:SokobanCSharp,代碼行數:6,代碼來源:BoardTest.cs

示例5: TestLoad

 public void TestLoad( string boardStr, string expected )
 {
     var board = new Board();
      board.Load( boardStr );
      Assert.AreEqual( expected, board.ToString() );
 }
開發者ID:rprouse,項目名稱:SokobanCSharp,代碼行數:6,代碼來源:BoardTest.cs

示例6: TestConvertToRunLengthEncoded

 public void TestConvertToRunLengthEncoded( string boardStr, string rleBoard )
 {
     var board = new Board();
      board.Load( boardStr );
      Assert.AreEqual( rleBoard, board.ToRunLengthEncodedString() );
 }
開發者ID:rprouse,項目名稱:SokobanCSharp,代碼行數:6,代碼來源:BoardTest.cs

示例7: TestCantMoveOnSolvedBoard

 public void TestCantMoveOnSolvedBoard( string boardStr, Move move )
 {
     var board = new Board();
      board.Load( boardStr );
      Assert.IsFalse( board.MakeMove( move ) );
 }
開發者ID:rprouse,項目名稱:SokobanCSharp,代碼行數:6,代碼來源:BoardTest.cs

示例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;
 }
開發者ID:rprouse,項目名稱:SokobanCSharp,代碼行數:11,代碼來源:BoardTest.cs

示例9: TestSolved

 public void TestSolved( string boardStr, bool isSolved )
 {
     var board = new Board();
      board.Load( boardStr );
      Assert.AreEqual( isSolved, board.IsSolved() );
 }
開發者ID:rprouse,項目名稱:SokobanCSharp,代碼行數:6,代碼來源:BoardTest.cs

示例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" );
 }
開發者ID:rprouse,項目名稱:SokobanCSharp,代碼行數:7,代碼來源:BoardTest.cs


注:本文中的Board.Load方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。