Пример #1
0
 public static BaseHero GetHeroByActivation(this GameContext gameContext, bool isActivation = true)
 {
     return(gameContext.DeskCards.GetHeroByIsFirst(gameContext.Players.First(c => c.IsActivation == isActivation).IsFirst));
 }
Пример #2
0
 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))));
 }
Пример #3
0
 /// <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)));
 }
Пример #4
0
        // 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));
        }
Пример #5
0
 public static void AddActionStatements(this GameContext context, IGameAction gameAction, ActionParameter actionParameter)
 {
     AddActionStatement(context, gameAction, actionParameter);
 }
Пример #6
0
 public static GameContextOutput WriteGameStatus(this GameContext gameContext, GameContextOutput gameContextOutput)
 {
     gameContextOutput.GameStatus = gameContext.GameStatus;
     return(gameContextOutput);
 }