Exemplo n.º 1
0
 public static BaseHero GetHeroByActivation(this GameContext gameContext, bool isActivation = true)
 {
     return(gameContext.DeskCards.GetHeroByIsFirst(gameContext.Players.First(c => c.IsActivation == isActivation).IsFirst));
 }
Exemplo n.º 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))));
 }
Exemplo n.º 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)));
 }
Exemplo n.º 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));
        }
Exemplo n.º 5
0
 public static void AddActionStatements(this GameContext context, IGameAction gameAction, ActionParameter actionParameter)
 {
     AddActionStatement(context, gameAction, actionParameter);
 }
Exemplo n.º 6
0
 public static GameContextOutput WriteGameStatus(this GameContext gameContext, GameContextOutput gameContextOutput)
 {
     gameContextOutput.GameStatus = gameContext.GameStatus;
     return(gameContextOutput);
 }