• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Turn类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Turn的典型用法代码示例。如果您正苦于以下问题:C# Turn类的具体用法?C# Turn怎么用?C# Turn使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Turn类属于命名空间,在下文中一共展示了Turn类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Connect4Board

 public Connect4Board()
 {
     columns = new Connect4Column[COLUMNS];
     for (int i = 0; i < columns.Length; i++)
         columns[i] = new Connect4Column();
     turn = Turn.NOT_IN_SESSION;
 }
开发者ID:Kevin-Jin,项目名称:kvj-board-games,代码行数:7,代码来源:Connect4Board.cs


示例2: Category

 public Category(string title, IRule rule, Turn turn, Dice dice)
 {
     Title = title;
     _rule = rule;
     _turn = turn;
     _dice = dice;
 }
开发者ID:Gryff,项目名称:yahtzee-kata,代码行数:7,代码来源:Category.cs


示例3: AddTurn

 public void AddTurn(Turn _turn)
 {
     if (m_trns == null) {
         m_trns = new List<Turn> ();
     }
     m_trns.Add (_turn);
 }
开发者ID:Derojo,项目名称:Medical,代码行数:7,代码来源:Match.cs


示例4: TurnCleanup

	public void TurnCleanup() {
		turn = new Turn();
		currentEffects.Remove(StatusEffect.Confuse);
        currentEffects.Remove(StatusEffect.Paralyse);
		currentEffects.Remove(StatusEffect.Shield);

	}
开发者ID:JimmehG,项目名称:pillarsOfFaith,代码行数:7,代码来源:Player.cs


示例5: Start

    void Start () {
        runeBucket = new List<Rune>();
		currentEffects = new List<StatusEffect>();
		turn = new Turn();
		animator = GetComponent<Animator>();
        sprRend = GetComponent<SpriteRenderer>();
	}
开发者ID:JimmehG,项目名称:pillarsOfFaith,代码行数:7,代码来源:Player.cs


示例6: GoldRush

        public GoldRush()
        {
            m_currentTurn = Turn.Start;
            m_numbersLeft = new List<short>[3];
            m_board = new short[Players, N];

            for (int i = 0; i < Players; i++)
            {
                m_numbersLeft[i] = new List<short>();
            }
            for (short i = 1; i <= N; i++)
            {
                m_numbersLeft[User].Add(i);
                m_numbersLeft[Opponent].Add(i);
                m_numbersLeft[Computer].Add(i);
            }

            m_history = new Dictionary<string, List<short[]>>();
            m_guaranteedPerson = new List<string>();
            m_dateToPlayers = new Dictionary<DateTime, List<string>>();
            m_isGuaranteedPerson = false;
            m_joinDate = DateTime.MinValue;
            Load();
             //   OptimalBet();
            Go();
        }
开发者ID:cperler,项目名称:MoolaMinMax,代码行数:26,代码来源:GoldRush.cs


示例7: CheckForPairs

 private static bool CheckForPairs(Turn thisGame)
 {
     var isPairs = false;
     var firstValue = thisGame.CurrentDice[0].Value;
     var quantityOfFirstValue = CountQuantityOfAValue(firstValue, thisGame);
     var secondValue = firstValue;
     var i = 0;
     while (firstValue == secondValue && i < 6)
     {
         secondValue = thisGame.CurrentDice[i].Value;
         i++;
     }
     var quantityOfSecondValue = CountQuantityOfAValue(secondValue, thisGame);
     var thirdValue = firstValue;
     var quantityOfThirdValue = 0;
     i = 0;
     while ((firstValue == thirdValue || secondValue == thirdValue) && i < 6)
     {
         thirdValue = thisGame.CurrentDice[i].Value;
         i++;
     }
     if (i != 7)
         quantityOfThirdValue = CountQuantityOfAValue(thirdValue, thisGame);
     if (quantityOfFirstValue == 2 && quantityOfSecondValue == 2 && quantityOfThirdValue == 2)
         isPairs = true;
     return isPairs;
 }
开发者ID:junier89,项目名称:GameArcadia,代码行数:27,代码来源:ScratchCheck.cs


示例8: SetUp

 public void SetUp()
 {
     _turn = Substitute.For<Turn>();
     _dice = Substitute.For<Dice>();
     _onesRule = Substitute.For<IRule>();
     _category = new Category("Ones", _onesRule, _turn, _dice);
 }
开发者ID:Gryff,项目名称:yahtzee-kata,代码行数:7,代码来源:CategoryShould.cs


示例9: SetActionToFree

 void SetActionToFree()
 {
     actionTurn = Turn.free;
     if(FreeAction != null){
         FreeAction();
     }
 }
开发者ID:taylorlc70,项目名称:WarOfTheRing,代码行数:7,代码来源:TurnManager.cs


示例10: BerzerkMovement

        private static void BerzerkMovement(Turn gameLogTurn, int distance, Combatant active,
            int speedNotFiring, int speedFiring, int direction, int enemyPos, int oldPos)
        {
            if (distance > 0)
            {
                // run to enemy!
                gameLogTurn.Movement.Add(new Phase { Actor = active.Template, Message = active.Name + " runs towards the enemy in blind fury!", Relevance = Relevance.Medium, Icon = moveIcon});

                var movement = speedNotFiring*direction;
                int newPos = active.Position + (movement <= distance ? movement : distance);
                if (newPos == enemyPos)
                {
                    gameLogTurn.Movement.Add(new Phase { Actor = active.Template, Message = active.Name + " enters close combat!", Relevance = Relevance.High, Icon = chargeIcon });
                    active.Melee = true;
                }

                if (speedFiring <= Math.Abs(oldPos - newPos))
                    active.CanFire = true;
                else
                    active.CanFire = false;

                active.Position = newPos;
            }
            else
            {
                gameLogTurn.Movement.Add(new Phase { Actor = active.Template, Message = active.Name + " hurls himself into the melee!", Relevance = Relevance.Medium, Icon = chargeIcon });
                active.CanFire = true;
            }
        }
开发者ID:Rawne,项目名称:laststand,代码行数:29,代码来源:AttackResolver.cs


示例11: ControlPage

        public ControlPage()
        {
            this.InitializeComponent();

            turn = Turn.none;
            direction = Direction.none;

            accelerometer = App.accelerometer;
            bluetooth = App.bluetooth;
            arduino = App.arduino;

            if( accelerometer == null || bluetooth == null || arduino == null )
            {
                Frame.Navigate( typeof( MainPage ) );
                return;
            }

            startButton.IsEnabled = true;
            stopButton.IsEnabled = true;
            disconnectButton.IsEnabled = true;

            bluetooth.ConnectionLost += Bluetooth_ConnectionLost;

            keepScreenOnRequest = new DisplayRequest();
            keepScreenOnRequest.RequestActive();

            App.arduino.pinMode( LR_DIRECTION_CONTROL_PIN, PinMode.OUTPUT );
            App.arduino.pinMode( FB_DIRECTION_CONTROL_PIN, PinMode.OUTPUT );
            App.arduino.pinMode( LR_MOTOR_CONTROL_PIN, PinMode.PWM );
            App.arduino.pinMode( FB_MOTOR_CONTROL_PIN, PinMode.PWM );

            App.arduino.pinMode(HEARTBEAT_LED_PIN, PinMode.OUTPUT);
        }
开发者ID:DavidShoe,项目名称:windows-remote-arduino-samples,代码行数:33,代码来源:ControlPage.xaml.cs


示例12: ControlPageMaisto

        public ControlPageMaisto()
        {
            this.InitializeComponent();

            turn = Turn.none;
            direction = Direction.none;

            accelerometer = App.accelerometer;
            bluetooth = App.bluetooth;
            arduino = App.arduino;

            if( accelerometer == null || bluetooth == null || arduino == null )
            {
                Frame.Navigate( typeof( MainPage ) );
                return;
            }

            startButton.IsEnabled = true;
            stopButton.IsEnabled = true;
            disconnectButton.IsEnabled = true;

            bluetooth.ConnectionLost += Bluetooth_ConnectionLost;

            keepScreenOnRequest = new DisplayRequest();
            keepScreenOnRequest.RequestActive();

            App.arduino.pinMode( FORWARD_CONTROL_PIN, PinMode.OUTPUT );
            App.arduino.pinMode( REVERSE_CONTROL_PIN, PinMode.OUTPUT );
            App.arduino.pinMode( LEFT_CONTROL_PIN, PinMode.OUTPUT );
            App.arduino.pinMode( RIGHT_CONTROL_PIN, PinMode.OUTPUT );
        }
开发者ID:DavidShoe,项目名称:windows-remote-arduino-samples,代码行数:31,代码来源:ControlPageMaisto.xaml.cs


示例13: DefaultMoveExecutor

        public DefaultMoveExecutor(string board, string newMove, Turn turn,
            GameState gameState, string whiteKingPosition, string blackKingPosition, string lastMove,
            bool whiteCanCastleKingSide, bool whiteCanCastleQueenSide, bool blackCanCastleKingSide,
            bool blackCanCastleQueenSide)
        {
            FieldPosition whiteKing = FieldPosition.ParsePosition(whiteKingPosition);
            FieldPosition blackKing = FieldPosition.ParsePosition(blackKingPosition);

            this.oldState = new BoardModel(GetBoard(board), turn, gameState, whiteKing, blackKing,
                whiteCanCastleKingSide, whiteCanCastleQueenSide, blackCanCastleKingSide, blackCanCastleQueenSide);

            this.newState = new BoardModel(GetBoard(board), turn, gameState, whiteKing, blackKing,
                whiteCanCastleKingSide, whiteCanCastleQueenSide, blackCanCastleKingSide, blackCanCastleQueenSide);

            // Parse new move
            string[] splt = newMove.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
            this.source = FieldPosition.ParsePosition(splt[0]);
            this.dest = FieldPosition.ParsePosition(splt[1]);

            if (lastMove != null)
            {
                // Parse last move
                splt = lastMove.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
                this.lastMoveSource = FieldPosition.ParsePosition(splt[0]);
                this.lastMoveDest = FieldPosition.ParsePosition(splt[1]);
            }

            this.sourcePiece = this.newState.Board[source.Row, source.Col];
        }
开发者ID:nikolay-spasov,项目名称:WebChess,代码行数:29,代码来源:DefaultMoveExecutor.cs


示例14: ControlPage

        public ControlPage()
        {
            this.InitializeComponent();

            turn = Turn.none;
            direction = Direction.none;

            accelerometer = App.accelerometer;
            bluetooth = App.bluetooth;
            arduino = App.arduino;

            if (accelerometer == null || bluetooth == null || arduino == null)
            {
                Frame.Navigate(typeof(MainPage));
                return;
            }

            startButton.IsEnabled = true;
            stopButton.IsEnabled = true;
            disconnectButton.IsEnabled = true;

            keepScreenOnRequest = new DisplayRequest();
            keepScreenOnRequest.RequestActive();

            App.arduino.pinMode(enableA, PinMode.OUTPUT);
            App.arduino.pinMode(MotorA1, PinMode.OUTPUT);
            App.arduino.pinMode(MotorA2, PinMode.OUTPUT);

            App.arduino.pinMode(enableB, PinMode.OUTPUT);
            App.arduino.pinMode(MotorB1, PinMode.OUTPUT);
            App.arduino.pinMode(MotorB2, PinMode.OUTPUT);

            arduino.digitalWrite(enableA, PinState.HIGH);
            arduino.digitalWrite(enableB, PinState.HIGH);
        }
开发者ID:PedroRendeiro,项目名称:arduino-robot,代码行数:35,代码来源:ControlPage.xaml.cs


示例15: GlobalBoardTurn

 internal GlobalBoardTurn(Turn turn, Card draw)
 {
     PlayCard = turn.Card;
     PlayIsDiscard = turn.Discard;
     DrawCard = draw;
     DrawLocation = turn.Draw;
 }
开发者ID:coel,项目名称:LostMonitors.Core,代码行数:7,代码来源:GlobalBoardTurn.cs


示例16: CheckForSingles

 private static bool CheckForSingles(Turn thisGame)
 {
     for (var i = 0; i < 6; i++)
         if (thisGame.CurrentDice[i].State.Equals(DieState.Unclicked)
             && (thisGame.CurrentDice[i].Value == 1 || thisGame.CurrentDice[i].Value == 5))
             return true;
     return false;
 }
开发者ID:junier89,项目名称:GameArcadia,代码行数:8,代码来源:ScratchCheck.cs


示例17: ExpectCanExecuteAlwaysFalseIfIfTurnNotStarted

        public void ExpectCanExecuteAlwaysFalseIfIfTurnNotStarted(GameCommand command)
        {
            var player = new Mock<IPlayer>();
            var provider = new Mock<IStateProvider>();

            var turn = new Turn(player.Object, provider.Object);
            Assert.False(turn.CanExecute(command));
        }
开发者ID:Corne,项目名称:VOC,代码行数:8,代码来源:TurnTest.cs


示例18: CreateTurnTest

        public void CreateTurnTest()
        {
            var player = new Mock<IPlayer>();
            var provider = new Mock<IStateProvider>();

            var turn = new Turn(player.Object, provider.Object);
            Assert.Equal(player.Object, turn.Player);
        }
开发者ID:Corne,项目名称:VOC,代码行数:8,代码来源:TurnTest.cs


示例19: TimerEventArgs

 public TimerEventArgs(int seconds, int playerSeconds, int opponentSeconds, bool running, Turn turn)
 {
     Seconds = seconds;
     Running = running;
     PlayerSeconds = playerSeconds;
     OpponentSeconds = opponentSeconds;
     CurrentTurn = turn;
 }
开发者ID:JulioCL,项目名称:Hearthstone-Deck-Tracker,代码行数:8,代码来源:TurnTimer.cs


示例20: endPlayerTurn

 public static void endPlayerTurn()
 {
     current_turn = Turn.Enemy;
     //		entityManagerS.getMech().current_ap =  entityManagerS.getMech().max_ap;
     entityManagerS.getMech().destroySelectionHexes();
     entityManagerS.getMech().allowSelectionHexesDraw();
     enemy_enumerator = entityManagerS.getEnemies().GetEnumerator();
     entityManagerS.getMech().current_ap =  0;
 }
开发者ID:ChrisRenke,项目名称:Precursor,代码行数:9,代码来源:gameManagerS.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Tween类代码示例发布时间:2022-05-24
下一篇:
C# Tuple类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap