当前位置: 首页>>代码示例>>C#>>正文


C# Situation.GetWinner方法代码示例

本文整理汇总了C#中Situation.GetWinner方法的典型用法代码示例。如果您正苦于以下问题:C# Situation.GetWinner方法的具体用法?C# Situation.GetWinner怎么用?C# Situation.GetWinner使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Situation的用法示例。


在下文中一共展示了Situation.GetWinner方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CannotWinWhileTheresBeerLeft

        public void CannotWinWhileTheresBeerLeft()
        {
            var pos = getStartPositions();
            pos[0] = Position.GreenGoal1;
            pos[1] = Position.GreenGoal2;
            pos[2] = Position.GreenGoal3;
            pos[3] = Position.GreenGoal4;

            var sit = new Situation(pos);
            sit.beers[(int)Piece.Green] = 1;

            Assert.AreEqual(Piece.None, sit.GetWinner());

            sit.DrinkBeers(Piece.Green, 1);

            Assert.AreEqual(Piece.Green, sit.GetWinner());
        }
开发者ID:omahlama,项目名称:Limake,代码行数:17,代码来源:SituationTest.cs

示例2: TripleFinishesOverOwnPiece

        public void TripleFinishesOverOwnPiece()
        {
            var pos = getStartPositions();
            pos[0] = Position.GreenGoal2;
            pos[1] = pos[2] = pos[3] = Position.GreenGoal1;

            var sit = new Situation(pos);
            var moves = sit.GetMoves(Piece.Green, 3);

            sit.ApplyMove(moves[0]);

            Assert.AreEqual(Piece.Green, sit.board[(int)Position.GreenGoal1]);
            Assert.AreEqual(Piece.Green, sit.board[(int)Position.GreenGoal2]);
            Assert.AreEqual(Piece.Green, sit.board[(int)Position.GreenGoal3]);
            Assert.AreEqual(Piece.Green, sit.board[(int)Position.GreenGoal4]);

            Assert.AreEqual(Piece.Green, sit.GetWinner());
        }
开发者ID:omahlama,项目名称:Limake,代码行数:18,代码来源:SituationTest.cs

示例3: TestYellowWins

        public void TestYellowWins()
        {
            Position[] pos = getStartPositions();
            pos[12] = Position.YellowGoal1;
            pos[13] = Position.YellowGoal2;
            pos[14] = Position.YellowGoal4;
            pos[15] = Position.YellowGoal3;
            Situation start = new Situation(pos);

            Assert.AreEqual(Piece.Yellow, start.GetWinner());
        }
开发者ID:omahlama,项目名称:Limake,代码行数:11,代码来源:SituationTest.cs

示例4: DoubleUnfoldsWhenPiecesBeforeItAreFilled

        public void DoubleUnfoldsWhenPiecesBeforeItAreFilled()
        {
            var pos = getStartPositions();
            pos[0] = Position.GreenGoal4;
            pos[1] = pos[2] = Position.GreenGoal2;
            pos[3] = Position.GreenGoal1;

            var sit = new Situation(pos);
            var moves = sit.GetMoves(Piece.Green, 2);

            sit.ApplyMove(moves[0]);

            Assert.AreEqual(Piece.Green, sit.board[(int)Position.GreenGoal1]);
            Assert.AreEqual(Piece.Green, sit.board[(int)Position.GreenGoal2]);
            Assert.AreEqual(Piece.Green, sit.board[(int)Position.GreenGoal3]);
            Assert.AreEqual(Piece.Green, sit.board[(int)Position.GreenGoal4]);

            Assert.AreEqual(Piece.Green, sit.GetWinner());
        }
开发者ID:omahlama,项目名称:Limake,代码行数:19,代码来源:SituationTest.cs

示例5: TestGreenWins

        public void TestGreenWins()
        {
            Position[] pos = getStartPositions();
            pos[0] = Position.GreenGoal2;
            pos[1] = Position.GreenGoal1;
            pos[2] = Position.GreenGoal4;
            pos[3] = Position.GreenGoal3;
            Situation start = new Situation(pos);

            Assert.AreEqual(Piece.Green, start.GetWinner());
        }
开发者ID:omahlama,项目名称:Limake,代码行数:11,代码来源:SituationTest.cs


注:本文中的Situation.GetWinner方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。