private CardEntity[] GetPlayerResourceCard(Resource type) { return(_context.GetEntities(CardMatcher.InBox) .Where(c => c.owner.Entity == _player && c.hasResourceCard && c.resourceCard.Type == type ).ToArray()); }
protected override void Execute(List <GameEntity> entities) { foreach (var e in entities) { var movingCards = _eventContext.GetEntities(GameEventMatcher.EventMoveDeckCard) .Select(ev => ev.eventMoveDeckCard.CardEntity); var cards = _cardContext.GetEntities(CardMatcher.DeckCard) .Except(movingCards) .ToArray() .Shuffle(); if (cards.Length > 0) { var drawCards = cards.Take(Math.Min(cards.Length, _setting.StartTurnDrawCount)); foreach (var c in drawCards) { EventMoveDeckCard.MoveCardToPlayer(c, e); } } } }
protected override void Execute(List <GameEntity> entities) { var players = _gameContext.GetEntities(GameMatcher.Player); var movingCards = _eventContext.GetEntities(GameEventMatcher.EventMoveDeckCard) .Select(e => e.eventMoveDeckCard.CardEntity); var cards = _cardContext.GetEntities(CardMatcher.DeckCard) .Except(movingCards) .ToArray() .Shuffle(); Assert.IsTrue(players.Count() * _setting.StartCardCount <= cards.Length); var i = 0; foreach (var p in players) { _setting.StartCardCount.Loop(() => { EventMoveDeckCard.MoveCardToPlayer(cards[i], p); i++; }); } }
public static CardEntity[] GetShareResourceCards(this CardContext context) { return(context.GetEntities(CardMatcher.ResourceCard) .Where(c => !c.hasOwner) .ToArray()); }
public static CardEntity[] GetResourceCards(this CardContext context) { return(context.GetEntities(CardMatcher.ResourceCard)); }
public static CardEntity[] GetBoxCards(this CardContext context) { return(context.GetEntities(CardMatcher.InBox)); }
public static CardEntity[] GetDeckCards(this CardContext context) { return(context.GetEntities(CardMatcher.DeckCard)); }
public static CardEntity[] GetPlayerSkills(this CardContext context, GameEntity playerEntity) { return(context.GetEntities(CardMatcher.SkillCard) .Where(e => e.owner.Entity == playerEntity) .ToArray()); }