public void TrashExcludeTrump(ITrash trash) { cards.Where(c => !c.Action.IsTrump) .ForEach(c => { trash.TrashCard(c); }); cards.RemoveAll(c => !c.Action.IsTrump); }
public void OnTurnEnd(ITrash trash) { // 現時点のペナルティカードを全てゴミ箱へ movePenarty.Concat(actionPenarty) .Where(c => c != null) .Distinct() .Where(c => !c.Action.IsTrump) // 切り札は捨てない .ForEach(c => { trash.TrashCard(c); }); // ペナルティをクリア for (int i = 0; i < movePenarty.Length; ++i) { movePenarty[i] = null; actionPenarty[i] = null; } // actionにプロットされているペナルティを反映 for (int i = 0; i < actionPlot.Length; ++i) { if (actionPlot[i] == null) { continue; } if (actionPlot[i].Action.PenartyMove) { movePenarty[i] = actionPlot[i]; } if (actionPlot[i].Action.PenartyAction) { actionPenarty[i] = actionPlot[i]; } } // プロットをクリア for (int i = 0; i < movePlot.Length; ++i) { movePlot[i] = null; actionPlot[i] = null; } }