public static BaseHero GetHeroByActivation(this GameContext gameContext, bool isActivation = true) { return(gameContext.DeskCards.GetHeroByIsFirst(gameContext.Players.First(c => c.IsActivation == isActivation).IsFirst)); }
public static bool IsThisActivationUserCard(this GameContext context, List <Card> cards) { return(context.Players.Any(c => c.IsActivation && c.AllCards.Any(x => cards.Any(n => n.CardInGameCode == x.CardInGameCode)))); }
/// <summary> /// 判断这张牌是否是当前回合玩家打出的牌 /// </summary> /// <param name="context"></param> /// <param name="card"></param> /// <returns></returns> public static bool IsThisActivationUserCard(this GameContext context, Card card) { return(context.Players.Any(c => c.IsActivation && c.AllCards.Any(x => x.CardInGameCode == card.CardInGameCode))); }
// public static void AddActionStatements(this GameContext context, IBuffRestore<ICardLocationFilter, IEvent> buff, ActionParameter actionParameter) // { // AddActionStatement(context, buff, actionParameter); // } /// <summary> /// 获取当前回合玩家 /// </summary> /// <param name="context"></param> /// <returns></returns> public static UserContext GetActivationUserContext(this GameContext context) { return(context.Players.First(c => c.IsActivation)); }
public static void AddActionStatements(this GameContext context, IGameAction gameAction, ActionParameter actionParameter) { AddActionStatement(context, gameAction, actionParameter); }
public static GameContextOutput WriteGameStatus(this GameContext gameContext, GameContextOutput gameContextOutput) { gameContextOutput.GameStatus = gameContext.GameStatus; return(gameContextOutput); }