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

C# PlayerPosition类代码示例

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

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



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

示例1: LabyrinthMoveUpTest

        public void LabyrinthMoveUpTest()
        {
            PlayerPosition startPosition = new PlayerPosition(3, 3);
            string[] rawData = new string[Labyrinth.LabyrinthSize]
            {
                "XXXXXXX",
                "X-X---X",
                "X---X-X",
                "X--*--X",
                "X-X----",
                "X-----X",
                "XXXXXXX"
            };
            Cell[,] board = LabyrinthDataFromStringArray(rawData);
            Labyrinth labyrinth = new Labyrinth(startPosition, board);
            var privateObject = new PrivateObject(labyrinth);
            privateObject.Invoke("ProcessMoveUp", 3, 3);
            string result =
                @"X X X X X X X 
X - X - - - X 
X - - * X - X 
X - - - - - X 
X - X - - - - 
X - - - - - X 
X X X X X X X 
";
            string expected = labyrinth.ToString();

            Assert.AreEqual(expected, result);                       
        }
开发者ID:Jarolim,项目名称:AllMyHomeworkForTelerikAcademy,代码行数:30,代码来源:Labyrinth.Tests.cs


示例2: AddMoves

        /// <summary>
        /// Adds all moves to Tree
        /// </summary>
        /// <param name="whitePos">Position of white figures on board</param>
        /// <param name="moves">Pairs of moves and replies e.g. ("e2-e4", "e7-e5")</param>
        public void AddMoves(PlayerPosition whitePos, params string[] moves)
        {
            Move temp = new Move(moves[0]);
            MoveNode tempNode = new MoveNode(temp);

            //iterator, that will add move to tree
            MoveIterator pushingIterator = null;

            MoveNode next = null;

            if (!rootMoves.ContainsKey(tempNode))
            {
                rootMoves.Add(tempNode, tempNode);
                next = rootMoves[tempNode].Add(new Move(moves[1]));
            }
            else
            {
                next = rootMoves[tempNode].Add(new Move(moves[1]));
            }

            pushingIterator = GetIterator(tempNode);
            //next answer
            pushingIterator.CurrentNode = next;

            int i = 2;
            while (i < moves.Length)
            {
                pushingIterator.CurrentNode = pushingIterator.CurrentNode.Add(moves[i], whitePos);
                ++i;
            }
        }
开发者ID:Ribtoks,项目名称:Queem,代码行数:36,代码来源:DebutGraph.cs


示例3: CheckPlayer

 void CheckPlayer(PlayerPosition pla, float start, float end)
 {
     var p = pla.transform.position.x;
     if( p >= start && p < end ) {
         this.detected_players_.Add(pla);
     }
 }
开发者ID:madeso,项目名称:nomoresweden2015,代码行数:7,代码来源:Eyes.cs


示例4: GetNextPlayerPosition

        public static PlayerPosition GetNextPlayerPosition(PlayerPosition currentSide)
        {
            if (currentSide.Order == 3)
                return PlayerPosition.North;

            return new PlayerPosition(currentSide.Order + 1);
        }
开发者ID:pdm55,项目名称:dds.net,代码行数:7,代码来源:BridgeHelper.cs


示例5: PlayCard

        public PlayerPosition PlayCard(Card card, PlayerPosition playerPosition)
        {
            _nextPlayer = BridgeHelper.GetNextPlayerPosition(playerPosition);

            if (_currentTrick.Deck.Count == 0)
            {
                _currentTrick = new Trick();
                _currentTrick.TrickDealer = playerPosition;
            }


            if (_currentTrick.Deck.Count <= 4)
            {
                card.PlayerPosition = playerPosition;
                _currentTrick.Deck.Cards.Add(card);
            }

            if (_currentTrick.Deck.Count == 4)
            {
                Tricks.Add(_currentTrick);
                var winner = FindWinner(_currentTrick, Contract.Trump);
                _currentTrick.TrickWinner = winner;
                _nextPlayer = winner;
                _currentTrick = new Trick() { TrickDealer = winner };
            }

            GameState[playerPosition].RemoveCard(card);

            return _nextPlayer;
        }
开发者ID:pdm55,项目名称:dds.net,代码行数:30,代码来源:BridgeGame.cs


示例6: PlayerInfo

 public PlayerInfo this[PlayerPosition position]
 {
     get
     {
         return new PlayerInfo(this.gameManager[position]);
     }
 }
开发者ID:razsilev,项目名称:TelerikAcademy_Homework,代码行数:7,代码来源:GameInfo.cs


示例7: Init

 public void Init(Action<Square> action, PlayerPosition position, Color color)
 {
     if (position == PlayerPosition.Up)
         this.ShuffleUp(action, color);
     else
         this.ShuffleDown(action, color);
 }
开发者ID:Ribtoks,项目名称:Queem,代码行数:7,代码来源:InitialFigureShuffler.cs


示例8: CreatePlayer

	public void CreatePlayer(PlayerPosition pos)
    {
		GameObject obj = (GameObject) Instantiate(characterModel, new Vector3(pos.x,0,pos.y), Quaternion.identity);

		Character suppo = obj.GetComponent<Character> ();
		suppo.id = pos.id;
		suppo.lastPosition = pos;
    }
开发者ID:niezbop,项目名称:RabbitMQ_MMO,代码行数:8,代码来源:WorldManager.cs


示例9: AddPosition

	public void AddPosition(PlayerPosition position)
	{

		if (position != null && position.id != null && position.id != "")
		{
			positions [position.id] = position;
		}
	}
开发者ID:niezbop,项目名称:RabbitMQ_MMO,代码行数:8,代码来源:PositionQueue.cs


示例10: SetupOrientation

 public void SetupOrientation(PlayerPosition pp)
 {
     if (pp == PlayerPosition.Up)
         this.rankMask = rank8;
     else
         if (pp == PlayerPosition.Down)
             this.rankMask = rank1;
 }
开发者ID:Ribtoks,项目名称:Queem,代码行数:8,代码来源:RookBitBoard.cs


示例11: PlayerBoard

        public PlayerBoard(PlayerPosition playerPosition, Color playerColor, MovesArrayAllocator arrayAllocator)
        {
            this.position = playerPosition;
            this.color = playerColor;
            this.allocator = arrayAllocator;

            this.ResetAll();
        }
开发者ID:Ribtoks,项目名称:Queem,代码行数:8,代码来源:PlayerBoard.cs


示例12: Bidding

        public Bidding(GameSession gameSession, PlayerPosition startPosition)
        {
            _gameSession = gameSession;

            Bids = new List<Bid>();

            CurrentTurn = startPosition;
        }
开发者ID:shahboura,项目名称:Tarneeb,代码行数:8,代码来源:Bidding.cs


示例13: SetPosition

 // --------------------------------------------------------------------------------
 // AccountToPosition
 // --------------------------------------------------------------------------------
 // Set position
 public static Coroutine SetPosition(string accountId, PlayerPosition position, GameDB.ActionOnResult<PlayerPosition> func = null)
 {
     return GameDB.instance.StartCoroutine(GameDB.Set<PlayerPosition>(
         "AccountToPosition",
         accountId,
         position,
         func
     ));
 }
开发者ID:judah4,项目名称:battle-of-mages,代码行数:13,代码来源:PositionsDB.cs


示例14: BridgeGame

 public BridgeGame(Dictionary<PlayerPosition, Deck> state, PlayerPosition declarer)
 {
     GameState = state;
     Tricks = new List<Trick>();
     Declarer = declarer;
     Dummy = BridgeHelper.GetNextPlayerPosition(BridgeHelper.GetNextPlayerPosition(declarer));
     Contract = new Contract();
     _currentTrick = new Trick() { TrickDealer = Declarer };
 }
开发者ID:pdm55,项目名称:dds.net,代码行数:9,代码来源:BridgeGame.cs


示例15: IsOnBoarderTest

        public void IsOnBoarderTest()
        {
            PlayerPosition startPosition = new PlayerPosition(3, 3);
            Labyrinth labyrinth = new Labyrinth(startPosition);
            var privateObject = new PrivateObject(labyrinth);
            var actual = privateObject.Invoke("IsOnBorder", 6, 6);

            Assert.AreEqual(true, actual);
        }
开发者ID:Jarolim,项目名称:AllMyHomeworkForTelerikAcademy,代码行数:9,代码来源:Labyrinth.Tests.cs


示例16: IsGameWonTestFalse

        public void IsGameWonTestFalse()
        {
            PlayerPosition startPosition = new PlayerPosition(3, 3);
            Labyrinth labyrinth = new Labyrinth(startPosition);
            var privateObject = new PrivateObject(labyrinth);
            var actual = privateObject.Invoke("IsGameWon", 3, 3);

            Assert.AreEqual(false, actual);
        }
开发者ID:Jarolim,项目名称:AllMyHomeworkForTelerikAcademy,代码行数:9,代码来源:Labyrinth.Tests.cs


示例17: SantaseGame

 public SantaseGame(IPlayer firstPlayer, IPlayer secondPlayer, PlayerPosition firstToPlay)
 {
     this.firstPlayerTotalPoints = 0;
     this.secondPlayerTotalPoints = 0;
     this.roundsCount = 0;
     this.firstPlayer = firstPlayer;
     this.secondPlayer = secondPlayer;
     this.firstToPlay = firstToPlay;
 }
开发者ID:darkyto,项目名称:HQC-Course,代码行数:9,代码来源:SantaseGame.cs


示例18: SendPosition

	public void SendPosition(PlayerPosition position)
	{
		channel.BasicPublish(
			exchange: POSITION_EXCHANGE_NAME,
			routingKey: POSITION_TAG_NAME,
			basicProperties: null,
			body: position.ToMessageData()
		);
	}
开发者ID:niezbop,项目名称:RabbitMQ_MMO,代码行数:9,代码来源:MessageHandler.cs


示例19: Start

	IEnumerator Start()
	{
		Application.runInBackground = true;
		id = System.Guid.NewGuid().ToString();
		lastPos = new PlayerPosition (id, 0, 0, 0);
		posQ.AddPosition (new PlayerPosition (id, 0, 0, 0));
		mh = new MessageHandler ();
		yield return StartCoroutine(mh.startListening ());
	}
开发者ID:niezbop,项目名称:RabbitMQ_MMO,代码行数:9,代码来源:MovementController.cs


示例20: Contract

 public Contract(PlayerPosition playerPosition, ContractType type, bool isDoubled = false, bool isReDoubled = false)
     : this()
 {
     this.IsAvailable = true;
     this.Type = type;
     this.PlayerPosition = playerPosition;
     this.OriginalBidder = playerPosition;
     this.IsDoubled = isDoubled;
     this.IsReDoubled = isReDoubled;
 }
开发者ID:kalinalazarova1,项目名称:TelerikAcademy,代码行数:10,代码来源:Contract.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# PlayerProfile类代码示例发布时间:2022-05-24
下一篇:
C# PlayerObject类代码示例发布时间: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