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


C# IHsGameState.PlayersTurn方法代码示例

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


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

示例1: TagChange


//.........这里部分代码省略.........
									gameState.GameHandler.HandlePlayerBackToHand(game.Entities[id], cardId, gameState.GetTurnNumber());
									gameState.ProposeKeyPoint(PlayToHand, id, ActivePlayer.Player);
								}
								else if(controller == game.Opponent.Id)
								{
									gameState.GameHandler.HandleOpponentPlayToHand(game.Entities[id], cardId, gameState.GetTurnNumber(), id);
									gameState.ProposeKeyPoint(PlayToHand, id, ActivePlayer.Opponent);
								}
								break;
							case DECK:
								if(controller == game.Player.Id)
								{
									gameState.GameHandler.HandlePlayerPlayToDeck(game.Entities[id], cardId, gameState.GetTurnNumber());
									gameState.ProposeKeyPoint(PlayToDeck, id, ActivePlayer.Player);
								}
								else if(controller == game.Opponent.Id)
								{
									gameState.GameHandler.HandleOpponentPlayToDeck(game.Entities[id], cardId, gameState.GetTurnNumber());
									gameState.ProposeKeyPoint(PlayToDeck, id, ActivePlayer.Opponent);
								}
								break;
							case REMOVEDFROMGAME:
							case SETASIDE:
							case GRAVEYARD:
								if(controller == game.Player.Id)
								{
									gameState.GameHandler.HandlePlayerPlayToGraveyard(game.Entities[id], cardId, gameState.GetTurnNumber());
									if(game.Entities[id].HasTag(HEALTH))
										gameState.ProposeKeyPoint(Death, id, ActivePlayer.Player);
								}
								else if(controller == game.Opponent.Id)
								{
									gameState.GameHandler.HandleOpponentPlayToGraveyard(game.Entities[id], cardId, gameState.GetTurnNumber(),
									                                                    gameState.PlayersTurn());
									if(game.Entities[id].HasTag(HEALTH))
										gameState.ProposeKeyPoint(Death, id, ActivePlayer.Opponent);
								}
								break;
							default:
								Logger.WriteLine($"WARNING - unhandled zone change (id={id}): {prevValue} -> {value}", "TagChange");
								break;
						}
						break;
					case TAG_ZONE.SECRET:
						switch((TAG_ZONE)value)
						{
							case TAG_ZONE.SECRET:
							case GRAVEYARD:
								if(controller == game.Player.Id)
									gameState.ProposeKeyPoint(SecretTriggered, id, ActivePlayer.Player);
								if(controller == game.Opponent.Id)
								{
									gameState.GameHandler.HandleOpponentSecretTrigger(game.Entities[id], cardId, gameState.GetTurnNumber(), id);
									gameState.ProposeKeyPoint(SecretTriggered, id, ActivePlayer.Opponent);
								}
								break;
							default:
								Logger.WriteLine($"WARNING - unhandled zone change (id={id}): {prevValue} -> {value}", "TagChange");
								break;
						}
						break;
					case GRAVEYARD:
					case SETASIDE:
					case CREATED:
					case TAG_ZONE.INVALID:
					case REMOVEDFROMGAME:
开发者ID:Rob2K2,项目名称:Hearthstone-Deck-Tracker,代码行数:67,代码来源:TagChangeHandler.cs

示例2: ZoneChangeFromPlay

		private static void ZoneChangeFromPlay(IHsGameState gameState, int id, IGame game, int value, int prevValue, int controller,
												string cardId)
		{
			switch((TAG_ZONE)value)
			{
				case HAND:
					if(controller == game.Player.Id)
					{
						gameState.GameHandler.HandlePlayerBackToHand(game.Entities[id], cardId, gameState.GetTurnNumber());
						gameState.ProposeKeyPoint(PlayToHand, id, ActivePlayer.Player);
					}
					else if(controller == game.Opponent.Id)
					{
						gameState.GameHandler.HandleOpponentPlayToHand(game.Entities[id], cardId, gameState.GetTurnNumber(), id);
						gameState.ProposeKeyPoint(PlayToHand, id, ActivePlayer.Opponent);
					}
					break;
				case DECK:
					if(controller == game.Player.Id)
					{
						gameState.GameHandler.HandlePlayerPlayToDeck(game.Entities[id], cardId, gameState.GetTurnNumber());
						gameState.ProposeKeyPoint(PlayToDeck, id, ActivePlayer.Player);
					}
					else if(controller == game.Opponent.Id)
					{
						gameState.GameHandler.HandleOpponentPlayToDeck(game.Entities[id], cardId, gameState.GetTurnNumber());
						gameState.ProposeKeyPoint(PlayToDeck, id, ActivePlayer.Opponent);
					}
					break;
				case REMOVEDFROMGAME:
				case SETASIDE:
				case GRAVEYARD:
					if(controller == game.Player.Id)
					{
						gameState.GameHandler.HandlePlayerPlayToGraveyard(game.Entities[id], cardId, gameState.GetTurnNumber());
						if(game.Entities[id].HasTag(HEALTH))
							gameState.ProposeKeyPoint(Death, id, ActivePlayer.Player);
					}
					else if(controller == game.Opponent.Id)
					{
						gameState.GameHandler.HandleOpponentPlayToGraveyard(game.Entities[id], cardId, gameState.GetTurnNumber(), gameState.PlayersTurn());
						if(game.Entities[id].HasTag(HEALTH))
							gameState.ProposeKeyPoint(Death, id, ActivePlayer.Opponent);
					}
					break;
				default:
					Log.Warn($"unhandled zone change (id={id}): {prevValue} -> {value}");
					break;
			}
		}
开发者ID:JDurman,项目名称:Hearthstone-Deck-Tracker,代码行数:50,代码来源:TagChangeHandler.cs

示例3: PredamageChange

		private static void PredamageChange(IHsGameState gameState, int id, IGame game, int value)
		{
			if(value <= 0)
				return;
			if(gameState.PlayersTurn())
				gameState.GameHandler.HandleOpponentDamage(game.Entities[id]);
		}
开发者ID:JDurman,项目名称:Hearthstone-Deck-Tracker,代码行数:7,代码来源:TagChangeHandler.cs

示例4: NumTurnsInPlayChange

		private static void NumTurnsInPlayChange(IHsGameState gameState, int id, IGame game, int value)
		{
			if(value <= 0)
				return;
			if(!gameState.PlayersTurn())
				gameState.GameHandler.HandleOpponentTurnStart(game.Entities[id]);
		}
开发者ID:JDurman,项目名称:Hearthstone-Deck-Tracker,代码行数:7,代码来源:TagChangeHandler.cs

示例5: NumMinionsPlayedThisTurnChange

		private static void NumMinionsPlayedThisTurnChange(IHsGameState gameState, int value)
		{
			if(value <= 0)
				return;
			if(gameState.PlayersTurn())
				gameState.GameHandler.HandlePlayerMinionPlayed();
		}
开发者ID:JDurman,项目名称:Hearthstone-Deck-Tracker,代码行数:7,代码来源:TagChangeHandler.cs


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