private void DiscardCards() { foreach (var card in _discardingCards) { card.HideHighlight(); EventMoveDeckCard.MoveCardToShareDeck(card.Entity); } }
public void MoveToBox(CardObject card) { if (!CanUseCard()) { return; } EventMoveDeckCard.MoveCardInToBox(card.Entity); CloseAction(); }
public void DiscardCard(CardObject card) { if (!CanUseCard()) { return; } EventMoveDeckCard.MoveCardToShareDeck(card.Entity); CloseAction(); }
public void MoveToShareDeck() { var system = new EventMoveCardSystem(_contexts); var p1 = CreatePlayerEntity(1); var card = _contexts.card.CreateEntity(); card.AddDeckCard(DeckCard.Move); card.AddOwner(p1); EventMoveDeckCard.MoveCardToShareDeck(card); system.Execute(); Assert.IsFalse(card.hasOwner); }
public void MoveInToBox() { var system = new EventMoveCardSystem(_contexts); var p1 = CreatePlayerEntity(1); var card = _contexts.card.CreateEntity(); card.AddDeckCard(DeckCard.Move); card.AddOwner(p1); EventMoveDeckCard.MoveCardInToBox(card); system.Execute(); Assert.AreEqual(p1, card.owner.Entity); Assert.IsTrue(card.hasInBox); }
public void MoveToPlayer() { var system = new EventMoveCardSystem(_contexts); var p1 = CreatePlayerEntity(1); var p2 = CreatePlayerEntity(2); var card = _contexts.card.CreateEntity(); card.AddDeckCard(DeckCard.Move); card.AddOwner(p1); EventMoveDeckCard.MoveCardToPlayer(card, p2); system.Execute(); Assert.AreEqual(p2, card.owner.Entity); }
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); } } } }
public void CreateEvent() { var p1 = CreatePlayerEntity(1); var p2 = CreatePlayerEntity(2); var card = _contexts.card.CreateEntity(); card.AddDeckCard(DeckCard.Move); card.AddOwner(p1); EventMoveDeckCard.MoveCardToPlayer(card, p2); var eventEntity = _contexts.gameEvent.GetEntities(); Assert.AreEqual(1, eventEntity.Length); Assert.IsTrue(eventEntity[0].hasEventMoveDeckCard); var e = eventEntity[0].eventMoveDeckCard; Assert.AreEqual(card, e.CardEntity); Assert.AreEqual(p2, e.TargetPlayerEntity); }
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++; }); } }