本文整理汇总了C#中IHsGameState.ProposeKeyPoint方法的典型用法代码示例。如果您正苦于以下问题:C# IHsGameState.ProposeKeyPoint方法的具体用法?C# IHsGameState.ProposeKeyPoint怎么用?C# IHsGameState.ProposeKeyPoint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IHsGameState
的用法示例。
在下文中一共展示了IHsGameState.ProposeKeyPoint方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Handle
//.........这里部分代码省略.........
Entity tmpEntity;
if (game.Entities.TryGetValue(actionStartingEntityId, out tmpEntity))
actionStartingCardId = tmpEntity.CardId;
}
if (!string.IsNullOrEmpty(actionStartingCardId))
{
if (actionStartingCardId == "BRM_007") //Gang Up
{
//if (playerEntity.Value != null && playerEntity.Value.GetTag(GAME_TAG.CURRENT_PLAYER) == 1)
//{
var target = match.Groups["target"].Value.Trim();
if (target.StartsWith("[") && HsLogReaderConstants.EntityRegex.IsMatch(target))
{
var cardIdMatch = HsLogReaderConstants.CardIdRegex.Match(target);
if(cardIdMatch.Success)
{
var targetCardId = cardIdMatch.Groups["cardId"].Value.Trim();
for(int i = 0; i < 3; i++)
{
var id = game.Entities.Count + i + 1;
if(!gameState.KnownCardIds.ContainsKey(id))
gameState.KnownCardIds.Add(id, targetCardId);
}
}
}
//}
}
else if (actionStartingCardId == "GVG_056") //Iron Juggernaut
{
// burrowing mine will be the entity created next
int id = game.Entities.Count + 1;
//if(playerEntity.Value == null || playerEntity.Value.GetTag(GAME_TAG.CURRENT_PLAYER) != 1)
//{
if(!gameState.KnownCardIds.ContainsKey(id))
gameState.KnownCardIds.Add(id, "GVG_056t");
//}
}
else if (actionStartingCardId == "GVG_031") //Recycle
{
// Recycled card will be the entity created next
int id = game.Entities.Count + 1;
//if(playerEntity.Value == null || playerEntity.Value.GetTag(GAME_TAG.CURRENT_PLAYER) != 1)
//{
gameState.ProposeKeyPoint(KeyPointType.CreateToDeck, id, ActivePlayer.Player);
var target = match.Groups["target"].Value.Trim();
if(target.StartsWith("[") && HsLogReaderConstants.EntityRegex.IsMatch(target))
{
var cardIdMatch = HsLogReaderConstants.CardIdRegex.Match(target);
if(cardIdMatch.Success)
{
var targetCardId = cardIdMatch.Groups["cardId"].Value.Trim();
if(!gameState.KnownCardIds.ContainsKey(id))
gameState.KnownCardIds.Add(id, targetCardId);
}
}
//}
}
else if (actionStartingCardId == "GVG_035") //Malorne
{
// Malorne will be the entity created next
int id = game.Entities.Count + 1;
//if(playerEntity.Value == null || playerEntity.Value.GetTag(GAME_TAG.CURRENT_PLAYER) != 1)
//{
if(!gameState.KnownCardIds.ContainsKey(id))
gameState.KnownCardIds.Add(id, "GVG_035");
// }
}
else
{
if (playerEntity.Value != null && playerEntity.Value.GetTag(GAME_TAG.CURRENT_PLAYER) == 1
&& !gameState.PlayerUsedHeroPower
|| opponentEntity.Value != null && opponentEntity.Value.GetTag(GAME_TAG.CURRENT_PLAYER) == 1
&& !gameState.OpponentUsedHeroPower)
{
var card = Database.GetCardFromId(actionStartingCardId);
if (card.Type == "Hero Power")
{
if (playerEntity.Value != null && playerEntity.Value.GetTag(GAME_TAG.CURRENT_PLAYER) == 1)
{
gameState.GameHandler.HandlePlayerHeroPower(actionStartingCardId, gameState.GetTurnNumber());
gameState.PlayerUsedHeroPower = true;
}
else if (opponentEntity.Value != null)
{
gameState.GameHandler.HandleOpponentHeroPower(actionStartingCardId, gameState.GetTurnNumber());
gameState.OpponentUsedHeroPower = true;
}
}
}
}
}
}
else if (logLine.Contains("BlockType=JOUST"))
{
gameState.JoustReveals = 2;
}
}
示例2: ControllerChange
private void ControllerChange(IHsGameState gameState, int id, IGame game, int prevValue, int value)
{
Entity entity;
if(!game.Entities.TryGetValue(id, out entity))
return;
if(prevValue <= 0)
{
entity.Info.OriginalController = value;
return;
}
if(entity.HasTag(PLAYER_ID))
return;
if(value == game.Player.Id)
{
if(entity.IsInZone(Zone.SECRET))
{
gameState.GameHandler.HandleOpponentStolen(entity, entity.CardId, gameState.GetTurnNumber());
gameState.ProposeKeyPoint(SecretStolen, id, ActivePlayer.Player);
}
else if(entity.IsInZone(PLAY))
gameState.GameHandler.HandleOpponentStolen(entity, entity.CardId, gameState.GetTurnNumber());
}
else if(value == game.Opponent.Id)
{
if(entity.IsInZone(Zone.SECRET))
{
gameState.GameHandler.HandlePlayerStolen(entity, entity.CardId, gameState.GetTurnNumber());
gameState.ProposeKeyPoint(SecretStolen, id, ActivePlayer.Player);
}
else if(entity.IsInZone(PLAY))
gameState.GameHandler.HandlePlayerStolen(entity, entity.CardId, gameState.GetTurnNumber());
}
}
示例3: ExhaustedChange
private static void ExhaustedChange(IHsGameState gameState, int id, IGame game, int value, int controller)
{
if(value <= 0)
return;
if(game.Entities[id].GetTag(CARDTYPE) != (int)TAG_CARDTYPE.HERO_POWER)
return;
if(controller == game.Player.Id)
gameState.ProposeKeyPoint(HeroPower, id, ActivePlayer.Player);
else if(controller == game.Opponent.Id)
gameState.ProposeKeyPoint(HeroPower, id, ActivePlayer.Opponent);
}
示例4: TagChange
public void TagChange(IHsGameState gameState, string rawTag, int id, string rawValue, IGame game, bool isRecursive = false)
{
if (gameState.LastId != id)
{
game.SecondToLastUsedId = gameState.LastId;
if (gameState.ProposedKeyPoint != null)
{
ReplayMaker.Generate(gameState.ProposedKeyPoint.Type, gameState.ProposedKeyPoint.Id, gameState.ProposedKeyPoint.Player, game);
gameState.ProposedKeyPoint = null;
}
}
gameState.LastId = id;
if (!game.Entities.ContainsKey(id))
game.Entities.Add(id, new Entity(id));
GAME_TAG tag;
if (!Enum.TryParse(rawTag, out tag))
{
int tmp;
if (int.TryParse(rawTag, out tmp) && Enum.IsDefined(typeof(GAME_TAG), tmp))
tag = (GAME_TAG)tmp;
}
var value = HsLogReaderV2.ParseTagValue(tag, rawValue);
var prevZone = game.Entities[id].GetTag(GAME_TAG.ZONE);
game.Entities[id].SetTag(tag, value);
if (tag == GAME_TAG.CONTROLLER && gameState.WaitForController != null && game.PlayerId == -1)
{
var p1 = game.Entities.FirstOrDefault(e => e.Value.GetTag(GAME_TAG.PLAYER_ID) == 1).Value;
var p2 = game.Entities.FirstOrDefault(e => e.Value.GetTag(GAME_TAG.PLAYER_ID) == 2).Value;
if (gameState.CurrentEntityHasCardId)
{
if (p1 != null)
p1.IsPlayer = value == 1;
if (p2 != null)
p2.IsPlayer = value != 1;
game.PlayerId = value;
game.OpponentId = value == 1 ? 2 : 1;
}
else
{
if (p1 != null)
p1.IsPlayer = value != 1;
if (p2 != null)
p2.IsPlayer = value == 1;
game.PlayerId = value == 1 ? 2 : 1;
game.OpponentId = value;
}
}
var controller = game.Entities[id].GetTag(GAME_TAG.CONTROLLER);
var player = game.Entities[id].HasTag(GAME_TAG.CONTROLLER) ? (controller == game.PlayerId ? "FRIENDLY" : "OPPOSING") : "";
var cardId = game.Entities[id].CardId;
if (tag == GAME_TAG.ZONE)
{
//Logger.WriteLine("--------" + player + " " + game.Entities[id].CardId + " " + (TAG_ZONE)prevZone + " -> " +
// (TAG_ZONE)value);
if (((TAG_ZONE)value == TAG_ZONE.HAND || ((TAG_ZONE)value == TAG_ZONE.PLAY) && game.IsMulliganDone) && gameState.WaitForController == null)
{
if (!game.IsMulliganDone)
prevZone = (int)TAG_ZONE.DECK;
if (controller == 0)
{
game.Entities[id].SetTag(GAME_TAG.ZONE, prevZone);
gameState.WaitForController = new { Tag = rawTag, Id = id, Value = rawValue };
//Logger.WriteLine("CURRENTLY NO CONTROLLER SET FOR CARD, WAITING...");
return;
}
}
switch ((TAG_ZONE)prevZone)
{
case TAG_ZONE.DECK:
switch ((TAG_ZONE)value)
{
case TAG_ZONE.HAND:
if (controller == game.PlayerId)
{
gameState.GameHandler.HandlePlayerDraw(cardId, gameState.GetTurnNumber());
gameState.ProposeKeyPoint(KeyPointType.Draw, id, ActivePlayer.Player);
}
else if (controller == game.OpponentId)
{
gameState.GameHandler.HandleOpponentDraw(gameState.GetTurnNumber());
gameState.ProposeKeyPoint(KeyPointType.Draw, id, ActivePlayer.Opponent);
}
break;
case TAG_ZONE.REMOVEDFROMGAME:
case TAG_ZONE.GRAVEYARD:
case TAG_ZONE.SETASIDE:
case TAG_ZONE.PLAY:
if (controller == game.PlayerId)
{
gameState.GameHandler.HandlePlayerDeckDiscard(cardId, gameState.GetTurnNumber());
gameState.ProposeKeyPoint(KeyPointType.DeckDiscard, id, ActivePlayer.Player);
}
else if (controller == game.OpponentId)
{
gameState.GameHandler.HandleOpponentDeckDiscard(cardId, gameState.GetTurnNumber());
gameState.ProposeKeyPoint(KeyPointType.DeckDiscard, id, ActivePlayer.Opponent);
}
break;
//.........这里部分代码省略.........
示例5: ZoneChangeFromSecret
private void ZoneChangeFromSecret(IHsGameState gameState, int id, IGame game, int value, int prevValue, int controller, string cardId)
{
switch((Zone)value)
{
case Zone.SECRET:
case GRAVEYARD:
if(controller == game.Player.Id)
gameState.ProposeKeyPoint(SecretTriggered, id, ActivePlayer.Player);
if(controller == game.Opponent.Id)
{
Entity entity;
if(!game.Entities.TryGetValue(id, out entity))
return;
gameState.GameHandler.HandleOpponentSecretTrigger(entity, cardId, gameState.GetTurnNumber(), id);
gameState.ProposeKeyPoint(SecretTriggered, id, ActivePlayer.Opponent);
}
break;
default:
Log.Warn($"unhandled zone change (id={id}): {prevValue} -> {value}");
break;
}
}
示例6: ZoneChangeFromHand
private void ZoneChangeFromHand(IHsGameState gameState, int id, IGame game, int value, int prevValue, int controller, string cardId)
{
Entity entity;
if(!game.Entities.TryGetValue(id, out entity))
return;
switch((Zone)value)
{
case PLAY:
if(controller == game.Player.Id)
{
gameState.GameHandler.HandlePlayerPlay(entity, cardId, gameState.GetTurnNumber());
gameState.ProposeKeyPoint(Play, id, ActivePlayer.Player);
}
else if(controller == game.Opponent.Id)
{
gameState.GameHandler.HandleOpponentPlay(entity, cardId, entity.GetTag(ZONE_POSITION),
gameState.GetTurnNumber());
gameState.ProposeKeyPoint(Play, id, ActivePlayer.Opponent);
}
break;
case REMOVEDFROMGAME:
case SETASIDE:
case GRAVEYARD:
if(controller == game.Player.Id)
{
gameState.GameHandler.HandlePlayerHandDiscard(entity, cardId, gameState.GetTurnNumber());
gameState.ProposeKeyPoint(HandDiscard, id, ActivePlayer.Player);
}
else if(controller == game.Opponent.Id)
{
gameState.GameHandler.HandleOpponentHandDiscard(entity, cardId, entity.GetTag(ZONE_POSITION),
gameState.GetTurnNumber());
gameState.ProposeKeyPoint(HandDiscard, id, ActivePlayer.Opponent);
}
break;
case Zone.SECRET:
if(controller == game.Player.Id)
{
gameState.GameHandler.HandlePlayerSecretPlayed(entity, cardId, gameState.GetTurnNumber(), (Zone)prevValue);
gameState.ProposeKeyPoint(SecretPlayed, id, ActivePlayer.Player);
}
else if(controller == game.Opponent.Id)
{
gameState.GameHandler.HandleOpponentSecretPlayed(entity, cardId, entity.GetTag(ZONE_POSITION),
gameState.GetTurnNumber(), (Zone)prevValue, id);
gameState.ProposeKeyPoint(SecretPlayed, id, ActivePlayer.Opponent);
}
break;
case DECK:
if(controller == game.Player.Id)
{
gameState.GameHandler.HandlePlayerMulligan(entity, cardId);
gameState.ProposeKeyPoint(KeyPointType.Mulligan, id, ActivePlayer.Player);
}
else if(controller == game.Opponent.Id)
{
gameState.GameHandler.HandleOpponentMulligan(entity, entity.GetTag(ZONE_POSITION));
gameState.ProposeKeyPoint(KeyPointType.Mulligan, id, ActivePlayer.Opponent);
}
break;
default:
Log.Warn($"unhandled zone change (id={id}): {prevValue} -> {value}");
break;
}
}
示例7: 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;
}
}
示例8: NumAttacksThisTurnChange
private void NumAttacksThisTurnChange(IHsGameState gameState, int id, IGame game, int value)
{
if(value <= 0)
return;
Entity entity;
if(!game.Entities.TryGetValue(id, out entity))
return;
var controller = entity.GetTag(CONTROLLER);
if(controller == game.Player.Id)
gameState.ProposeKeyPoint(Attack, id, ActivePlayer.Player);
else if(controller == game.Opponent.Id)
gameState.ProposeKeyPoint(Attack, id, ActivePlayer.Opponent);
}
示例9: ZoneChangeFromOther
private static void ZoneChangeFromOther(IHsGameState gameState, int id, IGame game, int value, int prevValue, int controller,
string cardId)
{
switch((TAG_ZONE)value)
{
case PLAY:
if(controller == game.Player.Id)
{
gameState.GameHandler.HandlePlayerCreateInPlay(game.Entities[id], cardId, gameState.GetTurnNumber());
gameState.ProposeKeyPoint(Summon, id, ActivePlayer.Player);
}
if(controller == game.Opponent.Id)
{
gameState.GameHandler.HandleOpponentCreateInPlay(game.Entities[id], cardId, gameState.GetTurnNumber());
gameState.ProposeKeyPoint(Summon, id, ActivePlayer.Opponent);
}
break;
case DECK:
if(controller == game.Player.Id)
{
if(gameState.JoustReveals > 0)
break;
gameState.GameHandler.HandlePlayerGetToDeck(game.Entities[id], cardId, gameState.GetTurnNumber());
gameState.ProposeKeyPoint(CreateToDeck, id, ActivePlayer.Player);
}
if(controller == game.Opponent.Id)
{
if(gameState.JoustReveals > 0)
break;
gameState.GameHandler.HandleOpponentGetToDeck(game.Entities[id], gameState.GetTurnNumber());
gameState.ProposeKeyPoint(CreateToDeck, id, ActivePlayer.Opponent);
}
break;
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:
Log.Warn($"unhandled zone change (id={id}): {prevValue} -> {value}");
break;
}
}
示例10: ZoneChangeFromSecret
private static void ZoneChangeFromSecret(IHsGameState gameState, int id, IGame game, int value, int prevValue, int controller,
string cardId)
{
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:
Log.Warn($"unhandled zone change (id={id}): {prevValue} -> {value}");
break;
}
}
示例11: NumAttacksThisTurnChange
private static void NumAttacksThisTurnChange(IHsGameState gameState, int id, IGame game, int value, int controller)
{
if(value > 0)
{
if(controller == game.Player.Id)
gameState.ProposeKeyPoint(Attack, id, ActivePlayer.Player);
else if(controller == game.Opponent.Id)
gameState.ProposeKeyPoint(Attack, id, ActivePlayer.Opponent);
}
}
示例12: CardTargetChange
private static void CardTargetChange(IHsGameState gameState, int id, IGame game, int value, int controller)
{
if(value <= 0)
return;
if(controller == game.Player.Id)
gameState.ProposeKeyPoint(PlaySpell, id, ActivePlayer.Player);
else if(controller == game.Opponent.Id)
gameState.ProposeKeyPoint(PlaySpell, id, ActivePlayer.Opponent);
}
示例13: EquippedWeaponChange
private static void EquippedWeaponChange(IHsGameState gameState, int id, IGame game, int value, int controller)
{
if(value != 0)
return;
if(controller == game.Player.Id)
gameState.ProposeKeyPoint(WeaponDestroyed, id, ActivePlayer.Player);
else if(controller == game.Opponent.Id)
gameState.ProposeKeyPoint(WeaponDestroyed, id, ActivePlayer.Opponent);
}
示例14: ExhaustedChange
private void ExhaustedChange(IHsGameState gameState, int id, IGame game, int value)
{
if(value <= 0)
return;
Entity entity;
if(!game.Entities.TryGetValue(id, out entity))
return;
var controller = entity.GetTag(CONTROLLER);
if(entity.GetTag(CARDTYPE) != (int)CardType.HERO_POWER)
return;
if(controller == game.Player.Id)
gameState.ProposeKeyPoint(HeroPower, id, ActivePlayer.Player);
else if(controller == game.Opponent.Id)
gameState.ProposeKeyPoint(HeroPower, id, ActivePlayer.Opponent);
}
示例15: ZoneChangeFromHand
private static void ZoneChangeFromHand(IHsGameState gameState, int id, IGame game, int value, int prevValue, int controller,
string cardId)
{
switch((TAG_ZONE)value)
{
case PLAY:
if(controller == game.Player.Id)
{
gameState.GameHandler.HandlePlayerPlay(game.Entities[id], cardId, gameState.GetTurnNumber());
gameState.ProposeKeyPoint(Play, id, ActivePlayer.Player);
}
else if(controller == game.Opponent.Id)
{
gameState.GameHandler.HandleOpponentPlay(game.Entities[id], cardId, game.Entities[id].GetTag(ZONE_POSITION),
gameState.GetTurnNumber());
gameState.ProposeKeyPoint(Play, id, ActivePlayer.Opponent);
}
break;
case REMOVEDFROMGAME:
case SETASIDE:
case GRAVEYARD:
if(controller == game.Player.Id)
{
gameState.GameHandler.HandlePlayerHandDiscard(game.Entities[id], cardId, gameState.GetTurnNumber());
gameState.ProposeKeyPoint(HandDiscard, id, ActivePlayer.Player);
}
else if(controller == game.Opponent.Id)
{
gameState.GameHandler.HandleOpponentHandDiscard(game.Entities[id], cardId, game.Entities[id].GetTag(ZONE_POSITION),
gameState.GetTurnNumber());
gameState.ProposeKeyPoint(HandDiscard, id, ActivePlayer.Opponent);
}
break;
case TAG_ZONE.SECRET:
if(controller == game.Player.Id)
{
gameState.GameHandler.HandlePlayerSecretPlayed(game.Entities[id], cardId, gameState.GetTurnNumber(), false);
gameState.ProposeKeyPoint(SecretPlayed, id, ActivePlayer.Player);
}
else if(controller == game.Opponent.Id)
{
gameState.GameHandler.HandleOpponentSecretPlayed(game.Entities[id], cardId, game.Entities[id].GetTag(ZONE_POSITION),
gameState.GetTurnNumber(), false, id);
gameState.ProposeKeyPoint(SecretPlayed, id, ActivePlayer.Opponent);
}
break;
case DECK:
if(controller == game.Player.Id)
{
gameState.GameHandler.HandlePlayerMulligan(game.Entities[id], cardId);
gameState.ProposeKeyPoint(Mulligan, id, ActivePlayer.Player);
}
else if(controller == game.Opponent.Id)
{
gameState.GameHandler.HandleOpponentMulligan(game.Entities[id], game.Entities[id].GetTag(ZONE_POSITION));
gameState.ProposeKeyPoint(Mulligan, id, ActivePlayer.Opponent);
}
break;
default:
Log.Warn($"unhandled zone change (id={id}): {prevValue} -> {value}");
break;
}
}