Esempio n. 1
0
 private void TestPosition(Logic.DropPiece dp, int expectedColumn, int expectedRow)
 {
     Assert.AreEqual(expectedColumn, dp.Positions[0].Column);
     Assert.AreEqual(expectedRow, dp.Positions[0].Row);
     Assert.AreEqual(expectedColumn + 1, dp.Positions[1].Column);
     Assert.AreEqual(expectedRow, dp.Positions[1].Row);
 }
Esempio n. 2
0
        private Logic.DropPiece CreateCheckeredDropPiece(double holdTimeSecs = 0.0)
        {
            var dp = new Logic.DropPiece();

            dp.HoldTime      = holdTimeSecs;
            dp.DownDropRate  = 1.0;
            dp.DropRateWhole = 0.5;
            dp.DropRateSplit = 0.25;
            dp.Reset(new PlayfieldPoint(0, 0), false, (c, r, aj) => c % 2 == 0 ? Cell.States.Black : Cell.States.White);
            return(dp);
        }
Esempio n. 3
0
        public void TestReset()
        {
            var dp  = new Logic.DropPiece();
            var dps = new Logic.DropPieceSimple();

            dp.Reset(new PlayfieldPoint(0, 0), false);
            Assert.AreEqual(DropPiece.State.Whole, dp.CurrentState);
            foreach (var row in dp.Cells)
            {
                foreach (var s in row)
                {
                    Assert.AreNotEqual(Cell.States.Disabled, s);
                    Assert.AreNotEqual(Cell.States.Empty, s);
                }
            }
        }