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


C# IHsGameState.GameEndKeyPoint方法代码示例

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


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

示例1: PlaystateChange

		private void PlaystateChange(IHsGameState gameState, int id, IGame game, int value)
		{
			if(value == (int)CONCEDED)
				gameState.GameHandler.HandleConcede();
			if(gameState.GameEnded)
				return;
			Entity entity;
			if(!game.Entities.TryGetValue(id, out entity) || !entity.IsPlayer)
				return;
			switch((PlayState)value)
			{
				case WON:
					gameState.GameEndKeyPoint(true, id);
					gameState.GameHandler.HandleWin();
					break;
				case LOST:
					gameState.GameEndKeyPoint(false, id);
					gameState.GameHandler.HandleLoss();
					break;
				case TIED:
					gameState.GameEndKeyPoint(false, id);
					gameState.GameHandler.HandleTied();
					break;
			}
		}
开发者ID:irufus,项目名称:Hearthstone-Deck-Tracker,代码行数:25,代码来源:TagChangeActions.cs

示例2: TagChange


//.........这里部分代码省略.........
							case HAND:
								if(controller == game.Player.Id)
								{
									gameState.GameHandler.HandlePlayerGet(game.Entities[id], cardId, gameState.GetTurnNumber());
									gameState.ProposeKeyPoint(Obtain, id, ActivePlayer.Player);
								}
								else if(controller == game.Opponent.Id)
								{
									gameState.GameHandler.HandleOpponentGet(game.Entities[id], gameState.GetTurnNumber(), id);
									gameState.ProposeKeyPoint(Obtain, id, ActivePlayer.Opponent);
								}
								break;
							default:
								Logger.WriteLine($"WARNING - unhandled zone change (id={id}): {prevValue} -> {value}", "TagChange");
								break;
						}
						break;
					default:
						Logger.WriteLine($"WARNING - unhandled zone change (id={id}): {prevValue} -> {value}", "TagChange");
						break;
				}
			}
			else if(tag == PLAYSTATE)
			{
				if(value == (int)CONCEDED)
					gameState.GameHandler.HandleConcede();
				if(!gameState.GameEnded)
				{
					if(game.Entities[id].IsPlayer)
					{
						switch((TAG_PLAYSTATE)value)
						{
							case WON:
								gameState.GameEndKeyPoint(true, id);
								gameState.GameHandler.HandleWin();
								gameState.GameHandler.HandleGameEnd();
								gameState.GameEnded = true;
								break;
							case LOST:
								gameState.GameEndKeyPoint(false, id);
								gameState.GameHandler.HandleLoss();
								gameState.GameHandler.HandleGameEnd();
								gameState.GameEnded = true;
								break;
							case TIED:
								gameState.GameEndKeyPoint(false, id);
								gameState.GameHandler.HandleTied();
								gameState.GameHandler.HandleGameEnd();
								break;
						}
					}
				}
			}
			else if(tag == CARDTYPE && value == (int)TAG_CARDTYPE.HERO)
				SetHeroAsync(id, game, gameState);
			else if(tag == CURRENT_PLAYER && value == 1)
			{
				var activePlayer = game.Entities[id].IsPlayer ? ActivePlayer.Player : ActivePlayer.Opponent;
				gameState.GameHandler.TurnStart(activePlayer, gameState.GetTurnNumber());
				if(activePlayer == ActivePlayer.Player)
					gameState.PlayerUsedHeroPower = false;
				else
					gameState.OpponentUsedHeroPower = false;
			}
			else if(tag == LAST_CARD_PLAYED)
				gameState.LastCardPlayed = value;
开发者ID:Rob2K2,项目名称:Hearthstone-Deck-Tracker,代码行数:67,代码来源:TagChangeHandler.cs

示例3: TagChange


//.........这里部分代码省略.........
                        {
                            case TAG_ZONE.PLAY:
                                if (controller == game.PlayerId)
                                    gameState.ProposeKeyPoint(KeyPointType.Summon, id, ActivePlayer.Player);
                                if (controller == game.OpponentId)
                                    gameState.ProposeKeyPoint(KeyPointType.Summon, id, ActivePlayer.Opponent);
                                break;
                            case TAG_ZONE.HAND:
                                if (controller == game.PlayerId)
                                {
                                    gameState.GameHandler.HandlePlayerGet(cardId, gameState.GetTurnNumber());
                                    gameState.ProposeKeyPoint(KeyPointType.Obtain, id, ActivePlayer.Player);
                                }
                                else if (controller == game.OpponentId)
                                {
                                    gameState.GameHandler.HandleOpponentGet(gameState.GetTurnNumber(), id);
                                    gameState.ProposeKeyPoint(KeyPointType.Obtain, id, ActivePlayer.Opponent);
                                }
                                break;
                        }
                        break;
                }
            }
            else if (tag == GAME_TAG.PLAYSTATE)
            {
                if (value == (int)TAG_PLAYSTATE.QUIT)
                    gameState.GameHandler.HandleConcede();
                if (!gameState.GameEnded)
                {
                    if (game.Entities[id].IsPlayer)
                    {
                        if (value == (int)TAG_PLAYSTATE.WON)
                        {
                            gameState.GameEndKeyPoint(true, id);
                            gameState.GameHandler.HandleWin();
                            gameState.GameHandler.HandleGameEnd();
                            gameState.GameEnded = true;
                        }
                        else if (value == (int)TAG_PLAYSTATE.LOST)
                        {
                            gameState.GameEndKeyPoint(false, id);
                            gameState.GameHandler.HandleLoss();
                            gameState.GameHandler.HandleGameEnd();
                            gameState.GameEnded = true;
                        }
                        else if (value == (int)TAG_PLAYSTATE.TIED)
                        {
                            gameState.GameEndKeyPoint(false, id);
                            gameState.GameHandler.HandleTied();
                            gameState.GameHandler.HandleGameEnd();
                        }
                    }
                }
            }
            else if (tag == GAME_TAG.CURRENT_PLAYER && value == 1)
            {
                var activePlayer = game.Entities[id].IsPlayer ? ActivePlayer.Player : ActivePlayer.Opponent;
                gameState.GameHandler.TurnStart(activePlayer, gameState.GetTurnNumber());
                if (activePlayer == ActivePlayer.Player)
                    gameState.PlayerUsedHeroPower = false;
                else
                    gameState.OpponentUsedHeroPower = false;
            }
            else if (tag == GAME_TAG.NUM_ATTACKS_THIS_TURN && value > 0)
            {
                if (controller == game.PlayerId)
开发者ID:radoraykov,项目名称:Hearthstone-Deck-Tracker,代码行数:67,代码来源:TagChangeHandler.cs

示例4: PlaystateChange

		private static void PlaystateChange(IHsGameState gameState, int id, IGame game, int value)
		{
			if(value == (int)CONCEDED)
				gameState.GameHandler.HandleConcede();
			if(gameState.GameEnded)
				return;
			if(!game.Entities[id].IsPlayer)
				return;
			switch((TAG_PLAYSTATE)value)
			{
				case WON:
					gameState.GameEndKeyPoint(true, id);
					gameState.GameHandler.HandleWin();
					gameState.GameHandler.HandleGameEnd();
					gameState.GameEnded = true;
					break;
				case LOST:
					gameState.GameEndKeyPoint(false, id);
					gameState.GameHandler.HandleLoss();
					gameState.GameHandler.HandleGameEnd();
					gameState.GameEnded = true;
					break;
				case TIED:
					gameState.GameEndKeyPoint(false, id);
					gameState.GameHandler.HandleTied();
					gameState.GameHandler.HandleGameEnd();
					break;
			}
		}
开发者ID:JDurman,项目名称:Hearthstone-Deck-Tracker,代码行数:29,代码来源:TagChangeHandler.cs


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