Example #1
0
        private void MakeSoleList()
        {
            // TODO: 言語切り替えられるようにする
            Util.GetCardInfos(out var cardInfos, Util.JapaneseCode);

            // 地域でフィルタする
            _su.FilterByRegion(ref cardInfos, RegionFlowLayoutPanel);

            // 希少度でフィルタする
            _su.FilterByRarity(ref cardInfos, RarityFlowLayoutPanel);

            // マナコストでフィルタする
            _su.FilterByManaCost(ref cardInfos, ManaCostFlowLayoutPanel);

            // スペル速度でフィルタする
            _su.FilterBySpellSpeed(ref cardInfos, SpellSpeedFlowLayoutPanel);

            // タイプでフィルタする
            _su.FilterByType(ref cardInfos, TypeFlowLayoutPanel);

            // 親タイプでフィルタする
            _su.FilterBySuperType(ref cardInfos, SuperTypeFlowLayoutPanel);

            // サブタイプでフィルタする
            _su.FilterBySubType(ref cardInfos, SubTypeFlowLayoutPanel);

            // 収集可能性でフィルタする
            if (OnlyCollectibleCheckBox.Checked)
            {
                cardInfos = cardInfos.Where(s => s.collectible == true).ToList();
            }

            SoleObjectListView.SetObjects(cardInfos);
        }
Example #2
0
        private void MakeSoleList()
        {
            //
            Util.GetCardInfos(out var allCardInfos, Util.JapaneseCode);
            List <CardDeckDetail> cardDeckDetails = new List <CardDeckDetail>();

            foreach (CardCodeAndCount cardCodeAndCount in _editedDeck)
            {
                cardDeckDetails.Add(new CardDeckDetail(allCardInfos, cardCodeAndCount));
            }

            // チャンピオンの枚数を数えて表示
            int championCount = 0;

            cardDeckDetails.Where(s => s.cardInfo.supertype == "チャンピオン").ToList()
            .ForEach(s => championCount += s.cardCodeAndCount.Count);

            ChampionCountLabel.Text = "チャンピオン: " + championCount.ToString() + " / 6";

            // ユニットの枚数を数えて表示
            int unitCount = 0;

            cardDeckDetails.Where(s => s.cardInfo.type == "ユニット").ToList()
            .ForEach(s => unitCount += s.cardCodeAndCount.Count);

            UnitCountLabel.Text = "ユニット(チャンピオン含む): " + unitCount;

            // スペルの枚数を数えて表示
            int spellCount = 0;

            cardDeckDetails.Where(s => s.cardInfo.type == "スペル").ToList()
            .ForEach(s => spellCount += s.cardCodeAndCount.Count);

            SpellCountLabel.Text = "スペル: " + spellCount;

            // 地域を表示
            StringBuilder regionStringBuilder = new StringBuilder();

            regionStringBuilder.Append("地域: ");
            cardDeckDetails.GroupBy(s => s.cardInfo.regionRef).Select(s => s.First()).ToList()
            .ForEach(s => regionStringBuilder.Append(s.cardInfo.region + " "));

            RegionListLabel.Text = regionStringBuilder.ToString();

            // デッキの枚数を数えて表示
            int cardsDeckCount = 0;

            cardDeckDetails.ForEach(s => cardsDeckCount += s.cardCodeAndCount.Count);

            CardsDeckCountLabel.Text = "カード枚数: " + cardsDeckCount + " / 40";

            // リストに表示するオブジェクトを設定
            SoleObjectListView.SetObjects(cardDeckDetails);

            ((Form1)MdiParent)._updateCardsDeck?.Invoke(_editedDeck); // TODO: 処理が重そう
        }