private TreeNode create_tree_node( TreeNode treeNode, UInt32 current_blood_num, BloodLineTree.BloodNode tree, int level )
    {
        var wp = this.wp_;
        var blood_data = new HBloodData();
        var bloodNode = tree;

        while( true ) {
            wp.HBloodTable.GetData( bloodNode.blood_num, ref blood_data );
            var newNode = new TreeNode(){
                Text = get_name_by_data( ref blood_data ),
                Tag = bloodNode.blood_num,
                ForeColor = current_blood_num == bloodNode.blood_num ? Color.Red : Color.Black,
            };

            if( bloodNode.childNode == null ) {
                treeNode.Nodes.Add( newNode );
            } else {
                treeNode.Nodes.Add( create_tree_node( newNode, current_blood_num, bloodNode.childNode, level+1 ) );
            }
            if( bloodNode.nextBrother == null ) {
                break;
            }
            bloodNode = bloodNode.nextBrother;
        }
        return treeNode;
    }
    public DispBloodLineForm( WP7 wp, UInt32 blood_num )
    {
        this.wp_ = wp;
        this.Setup_Cotrols();

        var blood_data = new HBloodData();

        this.wp_.HBloodTable.GetData( blood_num, ref blood_data );
        this.Text = String.Format( "{0} の牝系図", get_name_by_data( ref blood_data ) );

        this.DispBloodLine( blood_num );
    }
    public static HDamData CommandMain( WP7 wp, UInt32 horse_num, HDamData data )
    {
        var blood_data = new HBloodData();

        wp.HBloodTable.GetData( data.blood_num, ref blood_data );

        if( blood_data.factor_left >= 9 ) {
            blood_data.factor_left = 0;
        } else {
            blood_data.factor_left++;
        }
        wp.HBloodTable.SetData( data.blood_num, ref blood_data );
        wp.HBloodTable.Commit( data.blood_num );

        return data;
    }
    private string create_tree_text( UInt32 current_blood_num, BloodLineTree.BloodNode tree, int level )
    {
        var wp = this.wp_;
        var blood_data = new HBloodData();
        var node = tree;

        using( var sw = new System.IO.StringWriter() ) {
            while( true ) {
                wp.HBloodTable.GetData( node.blood_num, ref blood_data );
                var mark = current_blood_num == node.blood_num ? "※" : "";
                sw.Write( String.Format("{0}|- {1}{2}\r\n", indent(level), mark, get_name_by_data( ref blood_data )  ) );

                if( node.childNode != null ) {
                    sw.Write( create_tree_text( current_blood_num, node.childNode, level+1 ) );
                }

                if( node.nextBrother == null ) {
                    break;
                }
                node = node.nextBrother;
            }
            return sw.ToString();
        }
    }
    private void DispBloodLine( UInt32 blood_num )
    {
        var wp = this.wp_;
        var blood_data = new HBloodData();

        wp.HBloodTable.GetData( blood_num, ref blood_data );

        var current_blood_num = blood_num;
        var target_blood_num = current_blood_num;

        while( true ) {
            wp.HBloodTable.GetData( target_blood_num, ref blood_data );
            if( blood_data.mother_num == wp.Config.NullBloodNumber ) {
                break;
            }
            target_blood_num = blood_data.mother_num;
        }
        var tree = new BloodLineTree( wp, BloodLineTree.BloodLineType.MARE, target_blood_num );

        var parentNode = new TreeNode(){
            Text = String.Format("{0}", get_name_by_data( ref blood_data ) ),
            Tag = tree.Tree.blood_num,
        };

        if( tree.Tree.childNode == null ) {
            this.treeView.Nodes.Add( parentNode );
        } else {
            this.treeView.Nodes.Add( create_tree_node( parentNode, current_blood_num, tree.Tree.childNode, 0 ) );
        }
        this.treeView.ExpandAll();

        this.linkLabel.Click += ( obj, ev )=> {
            if( tree.Tree.childNode == null ) {
                Clipboard.SetText( String.Format( "{0}", get_name_by_data( ref blood_data ) ) );
            } else {
                Clipboard.SetText( String.Format( "{0}\r\n{1}",
                    get_name_by_data( ref blood_data ),
                    create_tree_text( target_blood_num, tree.Tree.childNode, 0 ) )
                );
            }
            MessageBox.Show( "クリップボードにコピーしました", "完了", MessageBoxButtons.OK, MessageBoxIcon.Information );
        };
    }
        private String GetDispName( WP7 wp, out String father_name, out String mother_name, ref HChildData data, ref HAblData abl_data, ref HBloodData father_blood_data, ref HBloodData mother_blood_data )
        {
            var name = "";

            //			var name_type = Helper.GetCountryByBokuzyouNum( abl_data.bokuzyou ) == Enums.CountryType.JAPAN
            //				? WP7_2012ULV.Enums.NameType.KANA
            //				: WP7_2012ULV.Enums.NameType.ENGLISH;
            var name_type = WP7_2012ULV.Enums.NameType.ENGLISH;

            if( this.ListViewConfig.DispNameType == WP7_2012ULV.Enums.NameType.KANA ) {
                name_type = WP7_2012ULV.Enums.NameType.KANA;
            }

            if( father_blood_data.display == 1 && name_type == WP7_2012ULV.Enums.NameType.ENGLISH ) {
                father_name = wp.馬名( WP7_2012ULV.Enums.NameType.ENGLISH, father_blood_data.name_left, father_blood_data.name_right );
            } else {
                father_name = wp.馬名( WP7_2012ULV.Enums.NameType.KANA, father_blood_data.name_left, father_blood_data.name_right );
            }

            if( mother_blood_data.display == 1 && name_type == WP7_2012ULV.Enums.NameType.ENGLISH ) {
                mother_name = wp.馬名( WP7_2012ULV.Enums.NameType.ENGLISH, mother_blood_data.name_left, mother_blood_data.name_right );
            } else {
                mother_name = wp.馬名( WP7_2012ULV.Enums.NameType.KANA, mother_blood_data.name_left, mother_blood_data.name_right );
            }

            if( data.shizitsu_num == wp.Config.NullShizitsuNumber ) {
                name = String.Format( "{0}の{1}歳", mother_name, data.age );
            } else {
                var blood_num = (UInt32) BitConverter.ToUInt16( wp.HShizitsuNameTable[ data.shizitsu_num ], 0 );
                var blood_data = new KOEI.WP7_2012.Datastruct.HBloodData();

                wp.HBloodTable.GetData( blood_num, ref blood_data );

                if( blood_data.display == 1 && name_type == WP7_2012ULV.Enums.NameType.ENGLISH ) {
                    name = String.Format( "☆{0}", wp.馬名( WP7_2012ULV.Enums.NameType.ENGLISH, blood_data.name_left, blood_data.name_right ) );
                } else {
                    name = String.Format( "☆{0}", wp.馬名( WP7_2012ULV.Enums.NameType.KANA, blood_data.name_left, blood_data.name_right ) );
                }
            }
            return name;
        }
Exemple #7
0
            /// <summary>
            /// コンストラクタ
            /// </summary>
            /// <param name="wp">WP7</param>
            /// <param name="type">血統タイプ</param>
            /// <param name="nodeLevel">ノードレベル</param>
            /// <param name="bloodNum">血統番号</param>
            /// <param name="line">ノードの位置を示す血統タイプの配列</param>
            /// <param name="fatherNode">父馬のノード</param>
            /// <param name="motherNode">母馬のノード</param>
            public Node( WP7 wp, 血統タイプ type, UInt32 nodeLevel, UInt32 bloodNum, 血統タイプ[] line, Node fatherNode, Node motherNode  )
            {
                this.Type = type;
                this.NodeLevel = nodeLevel;
                this.BloodNum = bloodNum;
                this.Line = line;

                this.Father = fatherNode;
                this.Mother = motherNode;

                var blood_data = new HBloodData();
                wp.HBloodTable.GetData( bloodNum, ref blood_data );

                this.Data = blood_data;
            }
        private String GetDispName( WP7 wp, out String father_name, out String mother_name, ref HBloodData blood_data, ref HAblData abl_data, ref HBloodData father_blood_data, ref HBloodData mother_blood_data )
        {
            //			var name_type = Helper.GetCountryByBokuzyouNum( abl_data.bokuzyou ) == Enums.CountryType.JAPAN
            //				? WP7_2012ULV.Enums.NameType.KANA
            //				: WP7_2012ULV.Enums.NameType.ENGLISH;
            var name_type = WP7_2012ULV.Enums.NameType.ENGLISH;

            if( this.ListViewConfig.DispNameType == WP7_2012ULV.Enums.NameType.KANA ) {
                name_type = WP7_2012ULV.Enums.NameType.KANA;
            }

            if( father_blood_data.display == 1 && name_type == WP7_2012ULV.Enums.NameType.ENGLISH ) {
                father_name = wp.馬名( WP7_2012ULV.Enums.NameType.ENGLISH, father_blood_data.name_left, father_blood_data.name_right );
            } else {
                father_name = wp.馬名( WP7_2012ULV.Enums.NameType.KANA, father_blood_data.name_left, father_blood_data.name_right );
            }

            if( mother_blood_data.display == 1 && name_type == WP7_2012ULV.Enums.NameType.ENGLISH ) {
                mother_name = wp.馬名( WP7_2012ULV.Enums.NameType.ENGLISH, mother_blood_data.name_left, mother_blood_data.name_right );
            } else {
                mother_name = wp.馬名( WP7_2012ULV.Enums.NameType.KANA, mother_blood_data.name_left, mother_blood_data.name_right );
            }

            var name = "";

            if( blood_data.display == 1 ) {
                name = wp.馬名( name_type, blood_data.name_left, blood_data.name_right );
            } else {
                name = wp.馬名( WP7_2012ULV.Enums.NameType.KANA, blood_data.name_left, blood_data.name_right );
            }
            return name;
        }
        /// <summary>
        /// スポイラーライクな編集を行う
        /// </summary>
        /// <param name="item_index">リストビューのアイテムインデックス</param>
        protected override void SpoilerLikeItemEdit( int item_index )
        {
            var item = this.ListView1.Items[ item_index ];
            var horse_num = (UInt32)((int)item.SubItems["horse_num"].Tag);

            var data = new KOEI.WP7_2012.Datastruct.HDamData();

            var blood_data = new HBloodData();
            var abl_data = new HAblData();
            var father_blood_data = new HBloodData();
            var mother_blood_data = new HBloodData();
            var family_line_data = new HFamilyLineData();

            this.WP7.HDamTable.GetData( horse_num, ref data );
            this.WP7.HAblTable.GetData( data.abl_num, ref abl_data );
            this.WP7.HBloodTable.GetData( data.blood_num, ref blood_data );
            this.WP7.HBloodTable.GetData( blood_data.father_num, ref father_blood_data );
            this.WP7.HBloodTable.GetData( blood_data.mother_num, ref mother_blood_data );
            this.WP7.HFamilyLineTable.GetData( blood_data.family_line_num, ref family_line_data );

            var father_name = String.Empty;
            var mother_name = String.Empty;
            var name = this.GetDispName( this.WP7, out mother_name, out father_name, ref blood_data, ref abl_data, ref father_blood_data, ref mother_blood_data );

            var form = new SpoilerLikeEditForm() {
                Text = String.Format( "{0} 編集中 - SpoilerALライク編集(β)", name ),
                Size = new System.Drawing.Size( 700, 800 ),
            };

            // 繁殖牝馬データの編集コントロール
            var data_editor = new SpoilerLikeControls.BitCheckList( this.WP7, HDamData.Properties, data.Decode() ){
                Dock = DockStyle.Fill,
                ControlsFont = this.ListView1.Font,
                DataChanged = ( new_data )=> {
                    if( this.WP7.TransactionWeekNumber != this.WP7.GetCurrentWeekNumber() ) {
                        var message = String.Format(
                            "データ取得時から週が変わっています({0}→{1})\r\n安全のため書き込みは行いません、再取得してください",
                            this.WP7.TransactionWeekNumber,
                            this.WP7.GetCurrentWeekNumber()
                        );
                        MessageBox.Show( message, "エラー", MessageBoxButtons.OK, MessageBoxIcon.Error );
                        form.DialogResult = DialogResult.Ignore;
                        return;
                    }
                    var temp_data = new HDamData();
                    temp_data.Encode( new_data );
                    this.WP7.HDamTable.SetData( horse_num, ref temp_data );
                    this.WP7.HDamTable.Commit( horse_num );
                    this.DataUpdateAndRefresh( item_index, horse_num, ref temp_data );
                },
            };

            // 能力データの編集コントロール
            var abl_data_editor = new SpoilerLikeControls.BitCheckList( this.WP7, HAblData.Properties, abl_data.Decode() ) {
                Dock = DockStyle.Fill,
                ControlsFont = this.ListView1.Font,
                DataChanged = ( new_abl_data )=> {
                    if( this.WP7.TransactionWeekNumber != this.WP7.GetCurrentWeekNumber() ) {
                        var message = String.Format(
                            "データ取得時から週が変わっています({0}→{1})\r\n安全のため書き込みは行いません、再取得してください",
                            this.WP7.TransactionWeekNumber,
                            this.WP7.GetCurrentWeekNumber()
                        );
                        MessageBox.Show( message, "エラー", MessageBoxButtons.OK, MessageBoxIcon.Error );
                        form.DialogResult = DialogResult.Ignore;
                        return;
                    }
                    var temp_data = new HAblData();
                    temp_data.Encode( new_abl_data );
                    this.WP7.HAblTable.SetData( data.abl_num, ref temp_data );
                    this.WP7.HAblTable.Commit( data.abl_num );
                    this.DataUpdateAndRefresh( item_index, horse_num, ref data );
                },
            };

            // 血統データの編集コントロール
            var blood_data_editor = new SpoilerLikeControls.BitCheckList( this.WP7, HBloodData.Properties, blood_data.Decode() ) {
                Dock = DockStyle.Fill,
                ControlsFont = this.ListView1.Font,
                DataChanged = ( new_blood_data )=> {
                    if( this.WP7.TransactionWeekNumber != this.WP7.GetCurrentWeekNumber() ) {
                        var message = String.Format(
                            "データ取得時から週が変わっています({0}→{1})\r\n安全のため書き込みは行いません、再取得してください",
                            this.WP7.TransactionWeekNumber,
                            this.WP7.GetCurrentWeekNumber()
                        );
                        MessageBox.Show( message, "エラー", MessageBoxButtons.OK, MessageBoxIcon.Error );
                        form.DialogResult = DialogResult.Ignore;
                        return;
                    }
                    var temp_data = new HBloodData();
                    temp_data.Encode( new_blood_data );
                    this.WP7.HBloodTable.SetData( data.blood_num, ref temp_data );
                    this.WP7.HBloodTable.Commit( data.blood_num );
                    this.DataUpdateAndRefresh( item_index, horse_num, ref data );
                },
            };

            // 系統データの編集コントロール
            var family_line_data_editor = new SpoilerLikeControls.BitCheckList( this.WP7, HFamilyLineData.Properties, family_line_data.Decode() ) {
                Dock = DockStyle.Fill,
                ControlsFont = this.ListView1.Font,
                DataChanged = ( new_family_line_data )=> {
                    if( this.WP7.TransactionWeekNumber != this.WP7.GetCurrentWeekNumber() ) {
                        var message = String.Format(
                            "データ取得時から週が変わっています({0}→{1})\r\n安全のため書き込みは行いません、再取得してください",
                            this.WP7.TransactionWeekNumber,
                            this.WP7.GetCurrentWeekNumber()
                        );
                        MessageBox.Show( message, "エラー", MessageBoxButtons.OK, MessageBoxIcon.Error );
                        form.DialogResult = DialogResult.Ignore;
                        return;
                    }
                    var temp_data = new HFamilyLineData();
                    temp_data.Encode( new_family_line_data );
                    this.WP7.HFamilyLineTable.SetData( blood_data.family_line_num, ref temp_data );
                    this.WP7.HFamilyLineTable.Commit( blood_data.family_line_num );
                    this.DataUpdateAndRefresh( item_index, horse_num, ref data );
                },
            };

            form.TabPageAdd( "能力データ", new Control[]{ abl_data_editor } );
            form.TabPageAdd( "繁殖牝馬データ", new Control[]{ data_editor } );
            form.TabPageAdd( "血統データ", new Control[]{ blood_data_editor } );
            form.TabPageAdd( String.Format( "{0}系データ", family_line_data.系統名() ), new Control[]{ family_line_data_editor } );

            if( form.ShowDialog() == DialogResult.Cancel ) {
                if( this.WP7.TransactionWeekNumber == this.WP7.GetCurrentWeekNumber() ) {
                    this.WP7.HDamTable.SetData( horse_num, ref data );
                    this.WP7.HDamTable.Commit( horse_num );
                    this.WP7.HAblTable.SetData( data.abl_num, ref abl_data );
                    this.WP7.HAblTable.Commit( data.abl_num );
                    this.WP7.HBloodTable.SetData( data.blood_num, ref blood_data );
                    this.WP7.HBloodTable.Commit( data.blood_num );
                    this.WP7.HFamilyLineTable.SetData( blood_data.family_line_num, ref family_line_data );
                    this.WP7.HFamilyLineTable.Commit( blood_data.family_line_num );
                    this.DataUpdateAndRefresh( item_index, horse_num, ref data );
                }
            }
        }
        /// <summary>
        /// 表示する馬リストを作成する
        /// </summary>
        /// <param name="wp"></param>
        /// <param name="arg">配合する繁殖牝馬の番号</param>
        /// <returns></returns>
        protected override ListViewItem[] CreateHorseListSub( KOEI.WP7_2012.WP7 wp, object arg )
        {
            this.__subitems_stack__ = new ListViewItem.ListViewSubItem[ DefaultColumnHeaders.Length ];

            var dam_num = (uint)arg;
            var dam_pedigree = new KOEI.WP7_2012.Horse.Pedigree( wp, dam_num, KOEI.WP7_2012.Horse.Breeding.Enums.血統タイプ.母系 );

            var family_line_info = KOEI.WP7_2012.Horse.FamilyLineInfo.CreateFamilyLineInfoList( wp, this.ListViewConfig.BreedingArea );

            var sire_data = new HSireData();
            var sire_blood_data = new HBloodData();
            var sire_abl_data = new HAblData();

            var items = new List< ListViewItem >();

            this.white_color_horse_ = 0;

            for( var i=0; i<wp.Config.HorseSireTable.RecordMaxLength; ++i )
            {
                var horse_num = i;

                wp.HSireTable.GetData( (uint)horse_num, ref sire_data );
                wp.HAblTable.GetData( sire_data.abl_num, ref sire_abl_data );

                if( !this.IsViewRecord( wp, (uint)horse_num, ref sire_data, ref sire_abl_data ) ) {
                    continue;
                }

                wp.HBloodTable.GetData( sire_data.blood_num, ref sire_blood_data );

                if( sire_blood_data.father_num == wp.Config.IgnoreBloodNumber ) {
                    continue;
                }

                var sire_pedigree = new KOEI.WP7_2012.Horse.Pedigree(
                    wp,
                    (uint)horse_num,
                    KOEI.WP7_2012.Horse.Breeding.Enums.血統タイプ.父系
                );

                var breeding = new KOEI.WP7_2012.Horse.Breeding.Breeding(
                    wp,
                    family_line_info,
                    this.ListViewConfig.BreedingArea,
                    sire_pedigree,
                    dam_pedigree
                );

                if( this.ListViewConfig.MaxRisk < breeding.Combination.GetPoint(wp).Risk ) {
                    continue;
                }

                items.Add( this.CreateListViewItemByHorseNum( wp, (uint)horse_num, ref sire_data, breeding ) );
            }

            return items.ToArray();
        }
Exemple #11
0
        private void ListView1_SelectedIndexChangedHandler( object sender, EventArgs e )
        {
            if( this.breedingTargetListView.ListView1.SelectedIndices.Count == 0 ) {
                return ;
            }
            var n = this.breedingTargetListView.ListView1.SelectedIndices[0];
            var item = this.breedingTargetListView.ListView1.Items[n];

            var horse_num = (uint)((int)item.SubItems["horse_num"].Tag);
            var blood_data = new HBloodData();

            switch( this.type_ ) {
            case KOEI.WP7_2012.Horse.Breeding.Enums.血統タイプ.父系:
                var sire_data = new HSireData();
                this.wp_.HSireTable.GetData( horse_num, ref sire_data );
                this.wp_.HBloodTable.GetData( sire_data.blood_num, ref blood_data );
                break;
            case KOEI.WP7_2012.Horse.Breeding.Enums.血統タイプ.母系:
                var dam_data = new HDamData();
                this.wp_.HDamTable.GetData( horse_num, ref dam_data );
                this.wp_.HBloodTable.GetData( dam_data.blood_num, ref blood_data );
                break;
            }

            var horse_name = this.GetDispName( ref blood_data );

            var sw = new System.Diagnostics.Stopwatch();

            try {
                sw.Start();
                this.BreedingAndDisp( horse_num );
                sw.Stop();

                var form = this.FindForm() as BreedingForm;
                if( form != null ) {
                    form.UpdateToolStripStatusLabel1Text( String.Format( "{0}(ms)", sw.ElapsedMilliseconds ) );
                    form.UpdateToolStripStatusLabel2Text( String.Format( "{0}(line)", this.breedingPartnerListView.ItemsCount ) );
                    form.UpdateToolStripStatusLabel3Text( String.Format( "{0}", horse_name ) );
                }
            } catch( Exception ex ) {
                sw.Stop();
                var message = String.Format( "エラーが発生しました - {0}", ex.Message );
                MessageBox.Show( message, "エラー", MessageBoxButtons.OK, MessageBoxIcon.Error );
            }
        }
Exemple #12
0
        private String GetDispName( ref HBloodData blood_data )
        {
            var name_type = WP7_2012ULV.Enums.NameType.ENGLISH;

            if( this.dispNameType_ == WP7_2012ULV.Enums.NameType.KANA ) {
                name_type = WP7_2012ULV.Enums.NameType.KANA;
            }
            if( blood_data.display == 1 ) {
                return this.wp_.馬名( name_type, blood_data.name_left, blood_data.name_right );
            } else {
                return this.wp_.馬名( WP7_2012ULV.Enums.NameType.KANA, blood_data.name_left, blood_data.name_right );
            }
        }
Exemple #13
0
        /// <summary>
        /// ラインブリードのチェックをする
        /// 
        /// --------------------------------------------------
        /// |        |             |    (あ)    | 父父父父   |
        /// |        |             |   父父父   +------------|
        /// |        |             |            | 父父父母   |
        /// |        |    父父     +------------+------------|
        /// |        |             |            | 父父母父   |
        /// |        |             |   父父母   +------------|
        /// |        |             |            | 父父母母   |
        /// | 父     |-------------+------------+------------|
        /// |        |             |    (い)    | 父母父父   |
        /// |        |             |   父母父   +------------|
        /// |        |             |            | 父母父母   |
        /// |        |    父母     +------------+------------|
        /// |        |             |            | 父母母父   |
        /// |        |             |   父母母   +------------|
        /// |        |             |            | 父母母母   |
        /// |--------+-------------+------------+------------|
        /// |        |             |    (う)    | 母父父父   |
        /// |        |             |   母父父   +------------|
        /// |        |             |            | 母父父母   |
        /// |        |    母父     +------------+------------|
        /// |        |             |            | 母父母父   |
        /// |        |             |   母父母   +------------|
        /// |        |             |            | 母父母母   |
        /// | 母     +-------------+------------+------------|
        /// |        |             |    (え)    | 母母父父   |
        /// |        |             |   母母父   +------------|
        /// |        |             |            | 母母父母   |
        /// |        |    母母     +------------+------------|
        /// |        |             |            | 母母母父   |
        /// |        |             |   母母母   +------------|
        /// |        |             |            | 母母母母   |
        /// --------------------------------------------------
        /// 
        /// 親系統ラインブリード4本爆発型(危険度1)
        /// 	3代目先祖の種牡馬4頭(あ・い・う・え)の親系統が全て同じで、
        /// 	子系統がすべて違う場合に成立します。
        /// 	父の特性がSPの場合は「親系統ラインブリード4本爆発SP型」になります。
        /// 	3代前の他の先祖馬がそれぞれ異なった親系統でないと、気性難や体質の弱化が起こる可能性 が高くなります。
        /// 
        /// 親系統ラインブリード3本爆発型(危険度1)
        /// 	3代目先祖の種牡馬4頭(あ・い・う・え)の うち、3頭の親系統が全て同じで、
        /// 	子系統がすべて違う場合に成立します。
        /// 	父の特性がSPの場合は「親系統ラインブリード3本爆発SP型」になります。
        /// 	3代前の他の先祖馬がそれぞれ異なった親系統でないと、気性難や体質の弱化が起こる可能性 が高くなります。
        /// 
        /// 親系統ラインブリード(危険度1)
        /// 	父母ともに、同じ親系統の場合成立します。
        /// 	父の特性がSPの場合は「親系統ラインブリードSP型」になります。3代前の祖先8頭のうち、
        /// 	親系統の種類が5より多いい場合は危険度が下がります。
        /// 
        /// 子系統ラインブリード(危険度2)
        /// 	父母ともに、同じ子系統の場合成立します。
        /// 	父の特性がSPの場合は「子系統ラインブリードSP型 」になります。
        /// 	3代前の祖先8頭のうち、親系統の種類が5より多いい場合は危険度が下がります。
        /// 
        ///		×父の特性がSPの場合は「子系統ラインブリードSP型 」になります。
        ///		○父と母の特性がSP型の場合は「子系統ラインブリードSP型 」になります。
        /// </summary>
        private void ラインブリードのチェック()
        {
            var target_blood_list = new List< Pedigree.Node >();

            // ラインブリード対象になる血統を取得
            foreach( var pedigree in new []{ this.SirePedigree, this.DamPedigree } ) {
                foreach( var node in pedigree.NodeList(2) ) {
                    if( node.Type == Enums.血統タイプ.父系 ) {
                        target_blood_list.Add( node );
                    }
                }
            }
            Debug.Assert( target_blood_list.Count == 4 );

            HBloodData
                blood1 = new HBloodData(),
                blood2 = new HBloodData(),
                blood3 = new HBloodData(),
                blood4 = new HBloodData();

            this.wp.HBloodTable.GetData( target_blood_list[0].BloodNum, ref blood1 );
            this.wp.HBloodTable.GetData( target_blood_list[1].BloodNum, ref blood2 );
            this.wp.HBloodTable.GetData( target_blood_list[2].BloodNum, ref blood3 );
            this.wp.HBloodTable.GetData( target_blood_list[3].BloodNum, ref blood4 );

            FamilyLineInfo
                child_line1  = this.family_line_info[ blood1.family_line_num ],
                child_line2  = this.family_line_info[ blood2.family_line_num ],
                child_line3  = this.family_line_info[ blood3.family_line_num ],
                child_line4  = this.family_line_info[ blood4.family_line_num ];

            // 出現率の1番多い親系統の数を数える
            var parent_line_match_count = 1;
            var info_ary = new []{ child_line1, child_line2, child_line3, child_line4, };

            for( var i=0; i<info_ary.Length; ++i ) {
                var temp = 1;
                for( var j=0; j<info_ary.Length; ++j ) {
                    if( i != j && info_ary[i].ParentFamilyLuneNum == info_ary[j].ParentFamilyLuneNum ) {
                        temp++;
                    }
                }
                if( temp > parent_line_match_count ) {
                    parent_line_match_count = temp;
                }
            }

            // 親系統ラインブリード爆発型のチェック
            if( parent_line_match_count >= 3 ) {
                // 子系統の種類を数える
                var child_num_ary = new UInt32[]{
                    blood1.family_line_num,
                    blood2.family_line_num,
                    blood3.family_line_num,
                    blood4.family_line_num,
                };
                // 重複カット
                child_num_ary = child_num_ary.Distinct().ToArray();

                if( parent_line_match_count == 4 && child_num_ary.Length == 4 ) {
                    if( child_line1.Data.family_line_attr == 1 ) {
                        this.Combination.ラインブリード = Enums.ラインブリード.親系統4本爆発SP型;
                    } else {
                        this.Combination.ラインブリード = Enums.ラインブリード.親系統4本爆発型;
                    }
                    return;
                }
                if( parent_line_match_count == 3 && child_num_ary.Length == 4 ) {
                    if( child_line1.Data.family_line_attr == 1 ) {
                        this.Combination.ラインブリード = Enums.ラインブリード.親系統3本爆発SP型;
                    } else {
                        this.Combination.ラインブリード = Enums.ラインブリード.親系統3本爆発型;
                    }
                    return;
                }
            }

            var father_family_line = this.family_line_info[ this.SirePedigree.Tree.Data.family_line_num ];
            var mother_family_line = this.family_line_info[ this.DamPedigree.Tree.Data.family_line_num ];

            // 子系統ラインブリードのチェック
            if( this.SirePedigree.Tree.Data.family_line_num == this.DamPedigree.Tree.Data.family_line_num ) {
                if( father_family_line.Data.family_line_attr == 1 ) {
                    this.Combination.ラインブリード = Enums.ラインブリード.子系統SP型;
                } else {
                    this.Combination.ラインブリード = Enums.ラインブリード.子系統;
                }
                return;
            }

            // 親系統ラインブリードのチェック
            // 資料とは少し違う
            if( father_family_line.ParentFamilyLuneNum == mother_family_line.ParentFamilyLuneNum ) {
                if( father_family_line.Data.family_line_attr == 1 && mother_family_line.Data.family_line_attr == 1 ) {
                    this.Combination.ラインブリード = Enums.ラインブリード.親系統SP型;
                } else {
                    this.Combination.ラインブリード = Enums.ラインブリード.親系統;
                }
                return;
            }
        }
Exemple #14
0
        /// <summary>
        /// 特殊配合のチェック
        /// 
        /// お笑い配合
        /// 	評価額が1億円以上で賢さも高い母に、種付け料100万円以下の父を配合する場合に成立します。
        /// 	精神力・賢さ・勝負根性・爆発力のアップが期待できます。
        /// 
        /// お似合い配合
        /// 	種付け料が200万円以下で賢さが高い父と、評価額が1000万円以下で賢さが高い母を配合する場合に成立します。
        /// 	精神力・賢さ・勝負根性・爆発力のアップが期待できます。
        /// 
        /// サヨナラ配合
        /// 	23歳以上で、同じ子系統の種牡馬がその地域(日本・米国・欧州)に1頭もいない父を配合する場合に成立します。
        /// 	神力・健康・勝負根性・爆発力のアップが期待できます。
        /// 
        /// Wサヨナラ配合
        /// 	サヨナラ配合が成立する父と、15歳以上で零細血統の母を配合する場合に成立します。
        /// 	精神力・賢さ・健康・パワー・勝負根性・瞬発力・爆発力のアップが期待できます。
        /// 	
        /// 稲妻配合
        /// 	瞬発力が高く勝負根性の低い父と、瞬発力が高く勝負根性の低い母を配合した場合に成立します。
        /// 	瞬発力・柔軟性・爆発力のアップが期待できますが、勝負根性がダウンします。
        /// 
        /// 真稲妻配合
        /// 	瞬発力が高く勝負根性の低い父(毛色が白毛または芦毛)と、
        /// 	瞬発力が高く勝負根性の低い母(毛色が白毛または芦毛)を配合した場合に成立します。
        /// 	瞬発力・柔軟性・爆発力のアップが期待できますが、勝負根性がダウンします。
        /// 
        /// 疾風配合
        /// 	勝負根性が高く瞬発力の低い父と、勝負根性が高く瞬発力の低い母を配合した場合に成立します。
        /// 	精神力・勝負根性・爆発力のアップが期待できますが、瞬発力がダウンします。
        /// 
        /// 真疾風配合
        /// 	勝負根性が高く瞬発力の低い父(毛色が黒鹿毛、青鹿毛または青毛)と、
        /// 	勝負根性が高く瞬発力の低い母(毛色が黒鹿毛、青鹿毛または青毛)を配合した場合に成立します。
        /// 	精神力・勝負根性・爆発力のアップが期待できますが、瞬発力がダウンします。
        /// 
        /// 3冠配合
        /// 	3冠馬の父と3冠馬の母を配合した場合に成立します(欧州3冠、秋古馬3冠など、普通の3冠以外でも可)。
        /// 	爆発力のアップが期待できます。
        /// </summary>
        private void 特殊配合のチェック()
        {
            HSireData
                sire_data = new HSireData();

            HDamData
                dam_data = new HDamData();

            HAblData
                sire_abl = new HAblData(),
                dam_abl = new HAblData();

            HBloodData
                sire_blood = new HBloodData(),
                dam_blood = new HBloodData();

            this.wp.HSireTable.GetData( this.SirePedigree.HorseNum, ref sire_data );
            this.wp.HDamTable.GetData( this.DamPedigree.HorseNum, ref dam_data );

            this.wp.HAblTable.GetData( sire_data.abl_num, ref sire_abl );
            this.wp.HAblTable.GetData( dam_data.abl_num, ref dam_abl );

            this.wp.HBloodTable.GetData( sire_data.blood_num, ref sire_blood );
            this.wp.HBloodTable.GetData( dam_data.blood_num, ref dam_blood );

            var tanetsuke_price = ( sire_data.tanetsuke >> 1 ) * 100 + ( ( sire_data.tanetsuke & 0x1 ) == 1 ? 50 : 0 );

            this.Combination.お笑い配合 = false;
            if( tanetsuke_price <= 100 && dam_data.price >= 100 && dam_abl.kashikosa >= 2 ) {
                this.Combination.お笑い配合 = true;
            }

            this.Combination.お似合い配合 = false;
            if( tanetsuke_price <= 200 && dam_data.price <= 10 && sire_abl.kashikosa >= 2 && dam_abl.kashikosa >= 2 ) {
                this.Combination.お似合い配合 = true;
            }

            this.Combination.サヨナラ配合 = false;
            this.Combination.Wサヨナラ配合 = false;
            if( (sire_data.age + 2) >= 23 && this.family_line_info[ sire_blood.family_line_num ].SireCount <= 1 ) {
                if( (dam_data.age + 2) > 15 && this.family_line_info[ dam_blood.family_line_num ].零細血統か() ) {
                    this.Combination.Wサヨナラ配合 = true;
                } else {
                    this.Combination.サヨナラ配合 = true;
                }
            }

            this.Combination.稲妻配合 = false;
            this.Combination.真稲妻配合 = false;
            if( sire_abl.syunpatsu == 3 && sire_abl.konzyou <= 1 && dam_abl.syunpatsu == 3 && dam_abl.konzyou <= 1 ) {
                if( ( sire_abl.keiro >= 6 && sire_abl.keiro <= 9 ) && ( dam_abl.keiro >= 6 && dam_abl.keiro <= 9 ) ) {
                    this.Combination.真稲妻配合 = true;
                } else {
                    this.Combination.稲妻配合 = true;
                }
            }

            this.Combination.真疾風配合 = false;
            this.Combination.疾風配合 = false;
            if( sire_abl.syunpatsu <= 1 && sire_abl.konzyou == 3 && dam_abl.syunpatsu <= 1 && dam_abl.konzyou == 3 ) {
                if( sire_abl.keiro == 1 && dam_abl.keiro == 1 ) {
                    this.Combination.真疾風配合 = true;
                } else {
                    this.Combination.疾風配合 = true;
                }
            }

            this.Combination.三冠配合 = false;
            if( Array.IndexOf( SANKAN_RACE_ID_LIST, dam_data.kachikura ) != -1 ) {
                foreach( var kachikura in new[]{ sire_data.kachikura_LB, sire_data.kachikura_LT, sire_data.kachikura_RB, sire_data.kachikura_RT } ) {
                    if( Array.IndexOf( SANKAN_RACE_ID_LIST, kachikura ) != -1 ) {
                        this.Combination.三冠配合 = true;
                        break;
                    }
                }
            }
        }
        private ListViewItem CreateListViewItemByHorseNum( KOEI.WP7_2012.WP7 wp, UInt32 horse_num, ref KOEI.WP7_2012.Datastruct.HRaceData data )
        {
            var abl_data = new HAblData();
            var father_data = new HSireData();
            var mother_data = new HDamData();
            var father_blood_data = new HBloodData();
            var mother_blood_data = new HBloodData();
            var father_family_line_data = new HFamilyLineData();
            var owner_ship_data = new HOwnershipRaceData();

            wp.HAblTable.GetData( data.abl_num, ref abl_data );
            wp.HSireTable.GetData( data.father_num, ref father_data );
            wp.HDamTable.GetData( data.mother_num, ref mother_data );
            wp.HBloodTable.GetData( father_data.blood_num, ref father_blood_data );
            wp.HBloodTable.GetData( mother_data.blood_num, ref mother_blood_data );
            wp.HFamilyLineTable.GetData( father_blood_data.family_line_num, ref father_family_line_data );

            var item = new ListViewItem() {
                Tag = (UInt32)horse_num,
            };

            String father_name, mother_name;

            var name = this.GetDispName( wp, out father_name, out mother_name, ref data, ref abl_data, ref father_blood_data, ref mother_blood_data );

            var age_value = data.age + 2;
            var is_ownership_horse = false;
            var seichou_value = data.seichou;

            if( data.owner == 41 ) {
                for( var ii=0; ii< wp.HOwnershipRaceTable.RecordCount; ++ii ) {
                    wp.HOwnershipRaceTable.GetData( (uint)ii, ref owner_ship_data );
                    if( owner_ship_data.horse_num == horse_num ) {
                        is_ownership_horse = true;
                        break;
                    }
                }
            }

            var career = data.career_dirt_1 + data.career_shiba_1
                    + data.career_dirt_2 + data.career_shiba_2
                    + data.career_dirt_3 + data.career_shiba_3
                    + data.career_dirt_4 + data.career_shiba_4;

            var is_shizitsu = data.shizitsu_num != wp.Config.NullShizitsuNumber;

            var subparams = new [] {
                new { raw_param = abl_data.power,     name = "power",     seichou = owner_ship_data.seichou_power, },
                new { raw_param = abl_data.syunpatsu, name = "syunpatsu", seichou = owner_ship_data.seichou_syunpatsu, },
                new { raw_param = abl_data.konzyou,   name = "konzyou",   seichou = owner_ship_data.seichou_konzyou, },
                new { raw_param = abl_data.zyuunan,   name = "zyuunan",   seichou = owner_ship_data.seichou_zyuunan, },
                new { raw_param = abl_data.seishin,   name = "seishin",   seichou = owner_ship_data.seichou_seishin, },
                new { raw_param = abl_data.kashikosa, name = "kashikosa", seichou = owner_ship_data.seichou_kashikosa, },
                new { raw_param = abl_data.health,    name = "health",    seichou = owner_ship_data.seichou_health, },
            };

            var zisou_race_name   = String.Empty;
            var zisou_sort_string = String.Empty;

            var race_distance = this.GetRaceString( ref wp, ref data, ref zisou_race_name, ref zisou_sort_string );

            var zyuunan = abl_data.zyuunan + owner_ship_data.seichou_zyuunan / 10;

            if( race_distance.レース距離() > abl_data.stamina.距離適性上限( zyuunan ) ) {
                item.ForeColor = System.Drawing.Color.Red;
            }

            if( abl_data.keiro == 9 ) {
                ++this.white_color_horse_;
            }

            var subparam_total = 0u;

            var n = 1;

            item.Text = String.Format( "{0}{1}",
                data.maruchihou != 0 ? "(地)"
                : abl_data.seisankoku != 0 && Helper.GetCountryByBokuzyouNum( abl_data.bokuzyou ) == Enums.CountryType.JAPAN ? "(外)" : "", name );

            item.SubItems[0].Tag = name;
            item.SubItems[0].Name = "name";

            __subitems_stack__[n++] = (new ListViewItem.ListViewSubItem() {
                Text = Helper.GetCountryByBokuzyouNum( abl_data.bokuzyou ).国().Substring( 0, 1 ),
                Tag = (int)abl_data.bokuzyou,
                Name = "country",
            });

            __subitems_stack__[n++] = (new ListViewItem.ListViewSubItem() {
                Text = age_value.ToString(),
                Tag = (int)age_value,
                Name = "age_value",
            });

            __subitems_stack__[n++] = (new ListViewItem.ListViewSubItem() {
                Text = data.gender.性別(),
                Tag = (int)data.gender,
                Name = "gender",
            });

            if( is_ownership_horse ) {
                var subparam_seichou_total = 0u;

                __subitems_stack__[n++] = (new ListViewItem.ListViewSubItem() {
                    Text = String.Format( "{0}({1})",
                        abl_data.speed + owner_ship_data.seichou_speed,
                        abl_data.speed
                    ).ToString(),
                    Tag = (int)( abl_data.speed + owner_ship_data.seichou_speed ),
                    Name = "speed",
                });
                __subitems_stack__[n++] = (new ListViewItem.ListViewSubItem() {
                    Text = abl_data.stamina.ToString(),
                    Tag = (int)abl_data.stamina,
                    Name = "stamina",
                });

                foreach( var param in subparams ) {
                    var param_value = param.raw_param + param.seichou / 10;
                    __subitems_stack__[n++] = (new ListViewItem.ListViewSubItem() {
                        Text = String.Format( "{0}({1,3})", param_value.サブパラ(), "+" + param.seichou.ToString() ),
                        Tag = (int)param_value,
                        Name = param.name,
                    });
                    subparam_total += param.raw_param + param.seichou / 10;
                    subparam_seichou_total += param.seichou / 10;
                }

                __subitems_stack__[n++] = (new ListViewItem.ListViewSubItem() {
                    Text = String.Format( "{0}({1,3})",
                        subparam_total,
                        "+" + subparam_seichou_total.ToString()
                    ).ToString() ,
                    Tag = (int)subparam_total,
                    Name = "subparam_total",
                });
            } else {
                __subitems_stack__[n++] = (new ListViewItem.ListViewSubItem() {
                    Text = String.Format( "{0}",
                        abl_data.speed
                    ).ToString() ,
                    Tag = (int)( abl_data.speed ),
                    Name = "speed",
                });
                __subitems_stack__[n++] = (new ListViewItem.ListViewSubItem() {
                    Text = abl_data.stamina.ToString(),
                    Tag = (int)abl_data.stamina,
                    Name = "stamina",
                });

                foreach( var param in subparams ) {
                    var param_value = param.raw_param;
                    __subitems_stack__[n++] = (new ListViewItem.ListViewSubItem() {
                        Text = String.Format( "{0}", param_value.サブパラ() ),
                        Tag = (int)param_value,
                        Name = param.name,
                    });
                    subparam_total += param.raw_param;
                }

                __subitems_stack__[n++] = (new ListViewItem.ListViewSubItem() {
                    Text = String.Format( "{0}",
                        subparam_total
                    ).ToString() ,
                    Tag = (int)subparam_total,
                    Name = "kisyou",
                });
            }

            __subitems_stack__[n++] = (new ListViewItem.ListViewSubItem() {
                Text = abl_data.kisyou.気性().Substring(0,1),
                Tag = (int)abl_data.kisyou,
                Name = "kisyou",
            });
            __subitems_stack__[n++] = (new ListViewItem.ListViewSubItem() {
                Text = abl_data.babatekisei.馬場適正().Substring(0,1),
                Tag = (int)abl_data.babatekisei,
                Name = "babatekisei",
            });
            __subitems_stack__[n++] = (new ListViewItem.ListViewSubItem() {
                Text = abl_data.senpou.戦法(),
                Tag = (int)abl_data.senpou,
                Name = "senpou",
            });
            __subitems_stack__[n++] = (new ListViewItem.ListViewSubItem() {
                Text = abl_data.seichougata.成長型(),
                Tag = (int)abl_data.seichougata,
                Name = "seichougata",
            });
            __subitems_stack__[n++] = (new ListViewItem.ListViewSubItem() {
                Text = abl_data.seichouryoku.成長力(),
                Tag = (int)abl_data.seichouryoku,
                Name = "seichouryoku",
            });
            __subitems_stack__[n++] = (new ListViewItem.ListViewSubItem() {
                Text = seichou_value.ToString(),
                Tag = (int)seichou_value,
                Name = "seichou_value",
            });
            __subitems_stack__[n++] = (new ListViewItem.ListViewSubItem() {
                Text = ( 100 + data.seigen ).ToString(),
                Tag = (int)data.seigen,
                Name = "seigen",
            });
            __subitems_stack__[n++] = (new ListViewItem.ListViewSubItem() {
                Text = data.zyumyou.ToString(),
                Tag = (int)data.zyumyou,
                Name = "zyumyou",
            });
            __subitems_stack__[n++] = (new ListViewItem.ListViewSubItem() {
                Text = String.Format( "{0} {1}", data.choushi, data.choushi_status.調子向き() ),
                Tag = (int)data.choushi,
                Name = "choushi",
            });
            __subitems_stack__[n++] = (new ListViewItem.ListViewSubItem() {
                Text = data.hirou.ToString(),
                Tag = (int)data.hirou,
                Name = "hirou",
            });

            __subitems_stack__[n++] = (new ListViewItem.ListViewSubItem() {
                Text = String.Format( "{0}{1}({2})",
                    data.weight_now > data.weight_best ? "+" : "",
                    ( (int)data.weight_now - (int)data.weight_best ) * 2,
                    ( data.weight_now * 2 ) + 370 ),
                Tag = (int)data.weight_now,
                Name = "weight",
            });

            __subitems_stack__[n++] = (new ListViewItem.ListViewSubItem() {
                Text = abl_data.stamina.距離適性( zyuunan ),
                Tag =  abl_data.stamina.距離適性上限( zyuunan ),
                Name = "kyoritekisei",
            });

            __subitems_stack__[n++] = (new ListViewItem.ListViewSubItem() {
                Text = abl_data.kodashi.ToString(),
                Tag = (int)abl_data.kodashi,
                Name = "kodashi",
            });
            __subitems_stack__[n++] = (new ListViewItem.ListViewSubItem() {
                Text = abl_data.keiro.毛色(),
                Tag = (int)abl_data.keiro,
                Name = "keiro",
            });
            __subitems_stack__[n++] = (new ListViewItem.ListViewSubItem() {
                Text = abl_data.taikou.体高(),
                Tag = (int)abl_data.taikou,
                Name = "taikou",
            });
            __subitems_stack__[n++] = (new ListViewItem.ListViewSubItem() {
                Text = abl_data.zenchou.全長(),
                Tag = (int)abl_data.zenchou,
                Name = "zenchou",
            });
            __subitems_stack__[n++] = (new ListViewItem.ListViewSubItem() {
                Text = data.souhou.走法().Substring( 0, 1 ),
                Tag = (int)data.souhou,
                Name = "souhou",
            });
            __subitems_stack__[n++] = (new ListViewItem.ListViewSubItem() {
                Text = abl_data.komawari_X.苦手(),
                Tag = (int)abl_data.komawari_X,
                Name = "komawari_X",
            });
            __subitems_stack__[n++] = (new ListViewItem.ListViewSubItem() {
                Text = data.hidarimawari_X.苦手(),
                Tag = (int)data.hidarimawari_X,
                Name = "hidarimawari_X",
            });
            __subitems_stack__[n++] = (new ListViewItem.ListViewSubItem() {
                Text = data.migimawari_X.苦手(),
                Tag = (int)data.migimawari_X,
                Name = "migimawari_X",
            });
            __subitems_stack__[n++] = (new ListViewItem.ListViewSubItem() {
                Text = data.weak_point_1.持病(),
                Tag = (int)data.weak_point_1,
                Name = "weak_point_1",
            });
            __subitems_stack__[n++] = (new ListViewItem.ListViewSubItem() {
                Text = data.weak_point_2.持病(),
                Tag = (int)data.weak_point_2,
                Name = "weak_point_2",
            });
            __subitems_stack__[n++] = (new ListViewItem.ListViewSubItem() {
                Text = data.weak_point_3.持病(),
                Tag = (int)data.weak_point_3,
                Name = "weak_point_3",
            });

            __subitems_stack__[n++] = (new ListViewItem.ListViewSubItem() {
                Text = abl_data.特性(" "),
                Tag = abl_data.特性二進数(),
                Name = "tokusei",
            });

            __subitems_stack__[n++] = (new ListViewItem.ListViewSubItem() {
                Text = father_name,
                Tag = father_name,
                Name = "father_name",
            });

            __subitems_stack__[n++] = (new ListViewItem.ListViewSubItem() {
                Text = father_family_line_data.系統名() + "系",
                Tag = father_family_line_data.系統名() + "系",
                Name = "father_family_line_",
            });

            __subitems_stack__[n++] = (new ListViewItem.ListViewSubItem() {
                Text = mother_name,
                Tag = mother_name,
                Name = "mother_name",
            });

            __subitems_stack__[n++] = (new ListViewItem.ListViewSubItem() {
                Text = career.ToString(),
                Tag = (int) career,
                Name = "race_len",
            });

            __subitems_stack__[n++] = (new ListViewItem.ListViewSubItem() {
                Text = String.Format( "{0,2} - {1,2} - {2,2} - {3,2}",
                    data.career_dirt_1 + data.career_shiba_1,
                    data.career_dirt_2 + data.career_shiba_2,
                    data.career_dirt_3 + data.career_shiba_3,
                    data.career_dirt_4 + data.career_shiba_4
                ),
                Tag = String.Format( "{0:D2}{1:D2}{2:D2}{3:D2}",
                    data.career_dirt_1 + data.career_shiba_1,
                    data.career_dirt_2 + data.career_shiba_2,
                    data.career_dirt_3 + data.career_shiba_3,
                    data.career_dirt_4 + data.career_shiba_4
                ),
                Name = "race_win_len",
            });

            __subitems_stack__[n++] = (new ListViewItem.ListViewSubItem() {
                Text = zisou_race_name,
                Tag = zisou_sort_string,
                Name = "zisou",
            });

            __subitems_stack__[n++] = (new ListViewItem.ListViewSubItem() {
                Text = data.klass.クラス(),
                Tag = (int) data.klass,
                Name = "klass",
            });
            __subitems_stack__[n++] = (new ListViewItem.ListViewSubItem() {
                Text = String.Format( "{0:N0}", ( data.earning_all ) ),
                Tag = (int) data.earning_all,
                Name = "earning_all",
            });
            __subitems_stack__[n++] = (new ListViewItem.ListViewSubItem() {
                Text = String.Format( "{0:N0}", ( data.earning_hon ) ),
                Tag = (int) data.earning_hon,
                Name = "earning_hon",
            });

            __subitems_stack__[n++] = (new ListViewItem.ListViewSubItem() {
                Text = abl_data.seisankoku.生産国(),
                Tag = (int) abl_data.seisankoku,
                Name = "seisankoku",
            });
            __subitems_stack__[n++] = (new ListViewItem.ListViewSubItem() {
                Text = data.owner.ToString(),
                Tag = (int) data.owner,
                Name = "owner",
            });
            __subitems_stack__[n++] = (new ListViewItem.ListViewSubItem() {
                Text = abl_data.bokuzyou.ToString(),
                Tag = (int) abl_data.bokuzyou,
                Name = "bokuzyou",
            });
            __subitems_stack__[n++] = (new ListViewItem.ListViewSubItem() {
                Text = data.trainer.ToString(),
                Tag = (int) data.trainer,
                Name = "trainer",
            });
            __subitems_stack__[n++] = (new ListViewItem.ListViewSubItem() {
                Text = data.shusen_jk_num.ToString(),
                Tag = (int) data.shusen_jk_num,
                Name = "shusen_jk_num",
            });

            __subitems_stack__[n++] = (new ListViewItem.ListViewSubItem() {
                Text = data.intai == 0 ? "○" : "×",
                Tag = data.intai == 0  ? 0 : 1,
                Name = "is_intai",
            });

            __subitems_stack__[n++] = (new ListViewItem.ListViewSubItem() {
                Text = is_shizitsu ? "○" : "",
                Tag = is_shizitsu  ? 1 : 0,
                Name = "is_shizitsu",
            });

            __subitems_stack__[n++] = (new ListViewItem.ListViewSubItem() {
                Text = String.Format( "0x{0:X4}", data.shizitsu_num ),
                Tag = (int)data.shizitsu_num,
                Name = "shizitsu_num",
            });
            __subitems_stack__[n++] = (new ListViewItem.ListViewSubItem() {
                Text = String.Format( "0x{0:X4}", data.abl_num ),
                Tag = (int)data.abl_num,
                Name = "abl_num",
            });
            __subitems_stack__[n++] = (new ListViewItem.ListViewSubItem() {
                Text = String.Format( "0x{0:X4}", horse_num ),
                Tag = (int)horse_num,
                Name = "horse_num",
            });
            __subitems_stack__[n++] = (new ListViewItem.ListViewSubItem() {
                Text = name,
                Tag = name,
                Name = "name2",
            });

            item.SubItems.AddRange( __subitems_stack__ );

            return item;
        }
        protected override ListViewItem[] CreateHorseListSub( KOEI.WP7_2012.WP7 wp, object arg )
        {
            this.__subitems_stack__ = new ListViewItem.ListViewSubItem[ DefaultColumnHeaders.Length ];

            var data = new HDamData();
            var blood_data = new HBloodData();
            var abl_data = new HAblData();

            var items = new List< ListViewItem >();

            this.white_color_horse_ = 0;

            if( this.ListViewConfig.TargetHorseNum != null ) {
                foreach( var horse_num in this.ListViewConfig.TargetHorseNum ) {
                    wp.HDamTable.GetData( horse_num, ref data );
                    var item = CreateListViewItemByHorseNum( wp, horse_num, ref data );
                    if( item == null ) {
                        return new ListViewItem[0];
                    }
                    return new ListViewItem[1] {
                        item,
                    };
                }
            }
            if( this.ListViewConfig.CurrentHorse ) {
                var n = wp.GetCurrentCharacterNumber();
                wp.HDamTable.GetData( n, ref data );
                var item = CreateListViewItemByHorseNum( wp, n, ref data );
                if( item == null ) {
                    return new ListViewItem[0];
                }
                return new ListViewItem[1] {
                    item,
                };
            }

            for( var i=0; i<wp.Config.HorseDamTable.RecordMaxLength; ++i )
            {
                var horse_num = i;

                wp.HDamTable.GetData( (uint)horse_num, ref data );
                wp.HAblTable.GetData( data.abl_num, ref abl_data );

                if( !this.IsViewRecord( wp, (uint)horse_num, ref data, ref abl_data ) ) {
                    continue;
                }

                wp.HBloodTable.GetData( data.blood_num, ref blood_data );

                if( blood_data.father_num == wp.Config.IgnoreBloodNumber ) {
                    continue;
                }

                items.Add( this.CreateListViewItemByHorseNum( wp, (uint)horse_num, ref data ) );
            }

            return items.ToArray();
        }
        private ListViewItem CreateListViewItemByHorseNum( 
            KOEI.WP7_2012.WP7 wp,
            UInt32 horse_num,
            ref KOEI.WP7_2012.Datastruct.HSireData data,
            KOEI.WP7_2012.Horse.Breeding.Breeding breeding
            )
        {
            var blood_data = new HBloodData();
            var abl_data = new HAblData();
            var father_blood_data = new HBloodData();
            var mother_blood_data = new HBloodData();
            var family_line_data = new HFamilyLineData();

            wp.HAblTable.GetData( data.abl_num, ref abl_data );

            wp.HBloodTable.GetData( data.blood_num, ref blood_data );
            wp.HFamilyLineTable.GetData( blood_data.family_line_num, ref family_line_data );

            wp.HBloodTable.GetData( blood_data.father_num, ref father_blood_data );
            wp.HBloodTable.GetData( blood_data.mother_num, ref mother_blood_data );

            var age_value = data.age + 2;
            var is_intai = data.intai != 0 ? true : false;

            var item = new ListViewItem();
            var n = 1;

            var subparams = new [] {
                new { raw_param = abl_data.power,     },
                new { raw_param = abl_data.syunpatsu, },
                new { raw_param = abl_data.konzyou,   },
                new { raw_param = abl_data.zyuunan,   },
                new { raw_param = abl_data.seishin,   },
                new { raw_param = abl_data.kashikosa, },
                new { raw_param = abl_data.health,    },
            };

            var father_name = String.Empty;
            var mother_name = String.Empty;

            var name = this.GetDispName( wp, out father_name, out mother_name, ref blood_data, ref abl_data, ref father_blood_data, ref mother_blood_data );

            if( abl_data.keiro == 9 ) {
                ++this.white_color_horse_;
            }
            var combination = breeding.Combination;
            var combinationPoint = breeding.Combination.GetPoint( wp );

            var subparam_total = 0u;

            item.Text = name;
            item.SubItems[0].Tag = name;

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = Helper.GetCountryByBokuzyouNum( abl_data.bokuzyou ).国().Substring( 0, 1 ),
                Tag = (int)abl_data.bokuzyou,
            });
            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = age_value.ToString(),
                Tag = (int)age_value,
            });
            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = abl_data.kodashi.ToString(),
                Tag = (int)abl_data.kodashi,
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = combinationPoint.Point.ToString(),
                Tag = (int)combinationPoint.Point,
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = combinationPoint.Risk.ToString(),
                Tag = (int)combinationPoint.Risk,
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = String.Format( "+{0}", combinationPoint.ニックス.Point ),
                Tag = (int) combinationPoint.ニックス.Point,
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = String.Format( "+{0,2},{1,3}", combinationPoint.インブリード.Point, 0 - (int)combinationPoint.インブリード.Risk ),
                Tag = (int) combinationPoint.インブリード.Point,
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = String.Format( "+{0},{1,2}", combinationPoint.ラインブリード.Point, 0 - (int)combinationPoint.ラインブリード.Risk ),
                Tag = (int) combinationPoint.ラインブリード.Point,
            });

            foreach( var objs in new object [][] {
                new object[] { combinationPoint.母父効果 },
                new object[] { combinationPoint.ライン活性配合, },
                new object[] { combinationPoint.血脈活性化配合, },
                new object[] { combinationPoint.活力源化大種牡馬因子, },
                new object[] { combinationPoint.活力源化名種牡馬因子, },
                new object[] { combinationPoint.隔世遺伝, },
                new object[] { combinationPoint.SP昇華配合, },
                new object[] { combinationPoint.ST昇華配合, },
                new object[] { combinationPoint.SPST融合配合, },
                new object[] { combinationPoint.完全型活力補完, },
                new object[] { combinationPoint.お笑い配合, },
                new object[] { combinationPoint.お似合い配合, },
                new object[] { combinationPoint.三冠配合 },
                new object[] { combination.サヨナラ配合 ? combinationPoint.サヨナラ配合 : combinationPoint.Wサヨナラ配合, },
                new object[] { combination.稲妻配合 ? combinationPoint.稲妻配合 : combinationPoint.真稲妻配合, },
                new object[] { combination.疾風配合 ? combinationPoint.疾風配合 : combinationPoint.真疾風配合, },
            }) {
                var p = (PointRiskPair) objs[0];
                var msg = "";

                msg = String.Format( "+{0}", p.Point );

                __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                    Text = msg,
                    Tag = (int) p.Point,
                });
            }

            foreach( var objs in new object [][] {
                new object[] { combination.名種牡馬型活力補完 },
                new object[] { combination.名牝型活力補完 },
                new object[] { combination.異系血脈型活力補完 },
            }) {
                var p = (uint) objs[0];
                var msg = "";

                msg = String.Format( "{0}本", p );

                __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                    Text = msg,
                    Tag = (int) p,
                });
            }

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = String.Format( "{0}",
                    abl_data.speed
                ).ToString() ,
                Tag = (int)( abl_data.speed ),
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = abl_data.stamina.ToString(),
                Tag = (int)abl_data.stamina,
            });
            foreach( var param in subparams ) {
                var param_value = param.raw_param;
                __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                    Text = String.Format( "{0}", param_value.サブパラ() ),
                    Tag = (int)param_value,
                });
                subparam_total += param.raw_param;
            }

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = String.Format( "{0}", subparam_total ),
                Tag = (int)subparam_total,
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = blood_data.factor_left.因子(),
                Tag = (int)blood_data.factor_left,
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = blood_data.factor_right.因子(),
                Tag = (int)blood_data.factor_right,
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = abl_data.kisyou.気性().Substring(0,1),
                Tag = (int)abl_data.kisyou,
            });
            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = abl_data.babatekisei.馬場適正().Substring(0,1),
                Tag = (int)abl_data.babatekisei,
            });
            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = abl_data.senpou.戦法(),
                Tag = (int)abl_data.senpou,
            });
            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = abl_data.seichougata.成長型(),
                Tag = (int)abl_data.seichougata,
            });
            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = abl_data.seichouryoku.成長力(),
                Tag = (int)abl_data.seichouryoku,
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = abl_data.stamina.距離適性( abl_data.zyuunan ),
                Tag =  abl_data.stamina.距離適性( abl_data.zyuunan ),
            });
            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = abl_data.keiro.毛色(),
                Tag = (int)abl_data.keiro,
            });
            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = abl_data.taikou.体高(),
                Tag = (int)abl_data.taikou,
            });
            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = abl_data.zenchou.全長(),
                Tag = (int)abl_data.zenchou,
            });
            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = abl_data.komawari_X.苦手(),
                Tag = (int)abl_data.komawari_X,
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = abl_data.特性(" "),
                Tag = abl_data.特性二進数(),
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = data.record_len.ToString(),
                Tag = (int)data.record_len,
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = data.record_win.ToString(),
                Tag = (int)data.record_win,
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = String.Format( "{0:N0}", (( data.tanetsuke >> 1 ) * 100 ) + ( data.tanetsuke == 1 ? 50 : 0 ) ),
                Tag = (int)data.tanetsuke,
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = data.bookfull == 1 ? "○" : "",
                Tag = (int)data.bookfull,
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = data.syndicate == 1 ? "○" : "",
                Tag = (int)data.syndicate,
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = String.Format( "{0:N0}", ( data.syoukin ) ),
                Tag = (int) data.syoukin,
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = String.Format( "{0:N0}", ( data.win_grade_count ) ),
                Tag = (int) data.win_grade_count,
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = String.Format( "{0:N0}", ( data.win_g1_count ) ),
                Tag = (int) data.win_g1_count,
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = ( data.rank_1_ago + 1 ).ToString(),
                Tag = (int)data.rank_1_ago,
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = ( data.rank_2_ago + 1 ).ToString(),
                Tag = (int)data.rank_2_ago,
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = ( data.rank_3_ago + 1 ).ToString(),
                Tag = (int)data.rank_3_ago,
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = ( data.rank_4_ago + 1 ).ToString(),
                Tag = (int)data.rank_4_ago,
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = father_name,
                Tag = father_name,
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = family_line_data.系統名() + "系",
                Tag = family_line_data.系統名() + "系",
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = mother_name,
                Tag = mother_name,
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = abl_data.seisankoku.生産国(),
                Tag = (int) abl_data.seisankoku,
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = abl_data.bokuzyou.ToString(),
                Tag = (int) abl_data.bokuzyou,
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = abl_data.特殊配合(),
                Tag = abl_data.特殊配合(),
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = data.intai == 0 ? "○" : "×",
                Tag = data.intai == 0  ? 0 : 1,
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = String.Format( "0x{0:X4}", data.abl_num ),
                Tag = (int)data.abl_num,
            });
            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = String.Format( "0x{0:X4}", horse_num ),
                Tag = (int)horse_num,
                Name = "horse_num",
            });
            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = name,
                Tag = name,
            });

            item.SubItems.AddRange( __subitems_stack__ );

            return item;
        }
        private ListViewItem CreateListViewItemByHorseNum( KOEI.WP7_2012.WP7 wp, UInt32 horse_num, ref KOEI.WP7_2012.Datastruct.HDamData data )
        {
            var blood_data = new HBloodData();
            var family_line_data = new HFamilyLineData();
            var abl_data = new HAblData();
            var father_blood_data = new HBloodData();
            var mother_blood_data = new HBloodData();
            var sire_data = new HSireData();
            var tanetsuke_blood_data = new HBloodData();

            wp.HAblTable.GetData( data.abl_num, ref abl_data );
            wp.HBloodTable.GetData( data.blood_num, ref blood_data );
            wp.HFamilyLineTable.GetData( blood_data.family_line_num, ref family_line_data );
            wp.HBloodTable.GetData( blood_data.father_num, ref father_blood_data );
            wp.HBloodTable.GetData( blood_data.mother_num, ref mother_blood_data );

            var age_value = data.age + 2;
            var is_intai = data.intai != 0 ? true : false;

            var item = new ListViewItem();

            var is_shizitsu = data.shizitsu_num != wp.Config.NullShizitsuNumber;

            var subparams = new [] {
                new { raw_param = abl_data.power,     },
                new { raw_param = abl_data.syunpatsu, },
                new { raw_param = abl_data.konzyou,   },
                new { raw_param = abl_data.zyuunan,   },
                new { raw_param = abl_data.seishin,   },
                new { raw_param = abl_data.kashikosa, },
                new { raw_param = abl_data.health,    },
            };

            var father_name = String.Empty;
            var mother_name = String.Empty;

            var name = this.GetDispName( wp, out father_name, out mother_name, ref blood_data, ref abl_data, ref father_blood_data, ref mother_blood_data );

            var tanetsuke_sire_name = "";

            if( data.tanetsuke_sire != wp.Config.NullSireNumber ) {
                wp.HSireTable.GetData( data.tanetsuke_sire, ref sire_data );
                wp.HBloodTable.GetData( sire_data.blood_num, ref tanetsuke_blood_data );

                if( this.ListViewConfig.DispNameType == WP7_2012ULV.Enums.NameType.KANA || tanetsuke_blood_data.display == 0 ) {
                    tanetsuke_sire_name = wp.馬名( WP7_2012ULV.Enums.NameType.KANA, tanetsuke_blood_data.name_left, tanetsuke_blood_data.name_right );
                } else {
                    tanetsuke_sire_name = wp.馬名( WP7_2012ULV.Enums.NameType.ENGLISH, tanetsuke_blood_data.name_left, tanetsuke_blood_data.name_right );
                }

            }

            var preg_shizitsu_name = "";

            if( data.preg_shizitsu_num != wp.Config.NullShizitsuNumber ) {
                var blood_num = (UInt32) BitConverter.ToUInt16( wp.HShizitsuNameTable[ data.preg_shizitsu_num ], 0 );
                var temp_blood_data = new KOEI.WP7_2012.Datastruct.HBloodData();
                wp.HBloodTable.GetData( blood_num, ref temp_blood_data );

                if( this.ListViewConfig.DispNameType == WP7_2012ULV.Enums.NameType.KANA || tanetsuke_blood_data.display == 0 ) {
                    preg_shizitsu_name = wp.馬名( WP7_2012ULV.Enums.NameType.KANA, temp_blood_data.name_left, temp_blood_data.name_right );
                } else {
                    preg_shizitsu_name = wp.馬名( WP7_2012ULV.Enums.NameType.ENGLISH, temp_blood_data.name_left, temp_blood_data.name_right );
                }
            }

            if( abl_data.keiro == 9 ) {
                ++this.white_color_horse_;
            }

            var n = 1;
            var subparam_total = 0u;

            item.Text = name;
            item.SubItems[0].Tag = name;

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = Helper.GetCountryByBokuzyouNum( abl_data.bokuzyou ).国().Substring( 0, 1 ),
                Tag = (int)abl_data.bokuzyou,
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = age_value.ToString(),
                Tag = (int)age_value,
            });
            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = String.Format( "{0}",
                    abl_data.speed
                ).ToString() ,
                Tag = (int)( abl_data.speed ),
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = abl_data.stamina.ToString(),
                Tag = (int)abl_data.stamina,
            });
            foreach( var param in subparams ) {
                var param_value = param.raw_param;
                __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                    Text = String.Format( "{0}", param_value.サブパラ() ),
                    Tag = (int)param_value,
                });
                subparam_total += param.raw_param;
            }

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = String.Format( "{0}", subparam_total ),
                Tag = (int)subparam_total,
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = blood_data.factor_left.因子(),
                Tag = (int)blood_data.factor_left,
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = blood_data.factor_right.因子(),
                Tag = (int)blood_data.factor_right,
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = abl_data.kodashi.ToString(),
                Tag = (int)abl_data.kodashi,
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = abl_data.kisyou.気性().Substring(0,1),
                Tag = (int)abl_data.kisyou,
            });
            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = abl_data.babatekisei.馬場適正().Substring(0,1),
                Tag = (int)abl_data.babatekisei,
            });
            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = abl_data.senpou.戦法(),
                Tag = (int)abl_data.senpou,
            });
            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = abl_data.seichougata.成長型(),
                Tag = (int)abl_data.seichougata,
            });
            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = abl_data.seichouryoku.成長力(),
                Tag = (int)abl_data.seichouryoku,
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = abl_data.stamina.距離適性( abl_data.zyuunan ),
                Tag =  abl_data.stamina.距離適性( abl_data.zyuunan ),
            });
            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = abl_data.keiro.毛色(),
                Tag = (int)abl_data.keiro,
            });
            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = abl_data.taikou.体高(),
                Tag = (int)abl_data.taikou,
            });
            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = abl_data.zenchou.全長(),
                Tag = (int)abl_data.zenchou,
            });
            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = abl_data.komawari_X.苦手(),
                Tag = (int)abl_data.komawari_X,
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = abl_data.特性(" "),
                Tag = abl_data.特性二進数(),
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = data.fuda_color.お札(),
                Tag = (int)data.fuda_color,
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = String.Format( "{0:N0}", ( data.price * 100 ) ),
                Tag = (int) data.price,
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = data.career_years.ToString(),
                Tag = (int)data.career_years,
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = data.career_count.ToString(),
                Tag = (int)data.career_count,
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = data.record_len.ToString(),
                Tag = (int)data.record_len,
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = data.record_win.ToString(),
                Tag = (int)data.record_win,
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = data.g1_win_count.ToString(),
                Tag = (int)data.g1_win_count,
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = data.kachikura.ToString(),
                Tag = (int)data.kachikura,
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = father_name,
                Tag = father_name,
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = family_line_data.系統名() + "系",
                Tag = family_line_data.系統名() + "系",
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = mother_name,
                Tag = mother_name,
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = abl_data.seisankoku.生産国(),
                Tag = (int) abl_data.seisankoku,
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = abl_data.bokuzyou.ToString(),
                Tag = (int) abl_data.bokuzyou,
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = data.status.繁殖牝馬状態(),
                Tag = (int) data.status,
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = tanetsuke_sire_name,
                Tag = tanetsuke_sire_name,
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = preg_shizitsu_name,
                Tag = preg_shizitsu_name,
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = abl_data.特殊配合(),
                Tag = abl_data.特殊配合(),
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = data.intai == 0 ? "○" : "×",
                Tag = data.intai == 0  ? 0 : 1,
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = is_shizitsu ? "○" : "",
                Tag = is_shizitsu  ? 1 : 0,
            });
            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = String.Format( "0x{0:X4}", data.shizitsu_num ),
                Tag = (int)data.shizitsu_num,
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = String.Format( "0x{0:X4}", data.abl_num ),
                Tag = (int)data.abl_num,
            });
            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = String.Format( "0x{0:X4}", horse_num ),
                Tag = (int)horse_num,
                Name = "horse_num",
            });
            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = name,
                Tag = name,
            });

            item.SubItems.AddRange( __subitems_stack__ );

            return item;
        }
        private String GetDispName( WP7 wp, out String father_name, out String mother_name, ref HBloodData blood_data, ref HAblData abl_data, ref HBloodData father_blood_data, ref HBloodData mother_blood_data )
        {
            var name_type = WP7_2012ULV.Enums.NameType.ENGLISH;

            if( this.ListViewConfig.DispNameType == WP7_2012ULV.Enums.NameType.KANA ) {
                name_type = WP7_2012ULV.Enums.NameType.KANA;
            }

            if( father_blood_data.display == 1 && name_type == WP7_2012ULV.Enums.NameType.ENGLISH ) {
                father_name = wp.馬名( WP7_2012ULV.Enums.NameType.ENGLISH, father_blood_data.name_left, father_blood_data.name_right );
            } else {
                father_name = wp.馬名( WP7_2012ULV.Enums.NameType.KANA, father_blood_data.name_left, father_blood_data.name_right );
            }

            if( mother_blood_data.display == 1 && name_type == WP7_2012ULV.Enums.NameType.ENGLISH ) {
                mother_name = wp.馬名( WP7_2012ULV.Enums.NameType.ENGLISH, mother_blood_data.name_left, mother_blood_data.name_right );
            } else {
                mother_name = wp.馬名( WP7_2012ULV.Enums.NameType.KANA, mother_blood_data.name_left, mother_blood_data.name_right );
            }

            var name = "";

            if( blood_data.display == 1 ) {
                name = wp.馬名( name_type, blood_data.name_left, blood_data.name_right );
            } else {
                name = wp.馬名( WP7_2012ULV.Enums.NameType.KANA, blood_data.name_left, blood_data.name_right );
            }
            return name;
        }
Exemple #20
0
        private void CreateTree( Node node )
        {
            if( node.NodeLevel == this.NODE_MAX_LEVEL ) {
                return;
            }
            var node_data   = new HBloodData();
            this.wp.HBloodTable.GetData( node.BloodNum, ref node_data );

            var line = new List< 血統タイプ >();
            line.AddRange( node.Line );
            line.Add( 血統タイプ.父系 );

            node.Father = new Node( this.wp, 血統タイプ.父系, node.NodeLevel + 1, node_data.father_num, line.ToArray() );
            this.CreateTree( node.Father );

            line.Clear();
            line.AddRange( node.Line );
            line.Add( 血統タイプ.母系 );

            node.Mother = new Node( this.wp, 血統タイプ.母系, node.NodeLevel + 1, node_data.mother_num, line.ToArray() );
            this.CreateTree( node.Mother );
        }
    private string get_name_by_data( ref HBloodData data )
    {
        var wp = this.wp_;
        var name = "";

        var obj = wp.HNameTable[ (int)data.name_left ];
        name = obj != null ? obj.Kana : String.Format ("(不明{0})", data.name_left );

        if( data.name_right != wp.Config.NullNameNumber ) {
            obj = wp.HNameTable[ (int)data.name_right ];
            name += obj != null ? obj.Kana : String.Format ("(不明{0})", data.name_right );
        }
        return name;
    }
        /// <summary>
        /// 地域の系統状態のリストを作成して返す
        /// </summary>
        /// <returns>系統状態のリスト</returns>
        public static FamilyLineInfo[] CreateFamilyLineInfoList( WP7 wp, Horse.Area country )
        {
            var info_list = new FamilyLineInfo[ wp.HFamilyLineTable.RecordCount ];

            for( var i=0; i<wp.HFamilyLineTable.RecordCount; ++i ) {
                var family_line_num = (uint)i;
                var family_line_data = new HFamilyLineData();
                wp.HFamilyLineTable.GetData( family_line_num, ref family_line_data );

                // 大元の親系統番号を取得する
                var parent_family_line_num = family_line_num;
                var parent_data = family_line_data;

                if( parent_data.family_line_num != wp.Config.NullFamilyLineNumber ) {
                    while( true ) {
                        if( parent_data.family_line_num == parent_family_line_num ) {
                            break;
                        }
                        parent_family_line_num = parent_data.family_line_num;

                        if( parent_family_line_num == wp.Config.NullFamilyLineNumber ) {
                            throw new Exception("[BUGもしくはデータが壊れています]");
                        }
                        wp.HFamilyLineTable.GetData( parent_family_line_num, ref parent_data );
                    }
                }
                info_list[ family_line_num ] = new FamilyLineInfo( country, family_line_num, parent_family_line_num, ref family_line_data );
            }

            var sire_total_length = 0;

            for( var i=0; i<wp.HSireTable.RecordCount; ++i ) {
                var sire_num = (uint)i;
                var data = new HSireData();
                var abl = new HAblData();
                var blood = new HBloodData();

                wp.HSireTable.GetData( sire_num, ref data );

                if( data.intai != 0 ) {
                    continue;
                }

                wp.HAblTable.GetData( data.abl_num, ref abl );

                if( 牧場はどこの地域か( abl.bokuzyou ) != country ) {
                    continue;
                }

                wp.HBloodTable.GetData( data.blood_num, ref blood );

                if( blood.father_num == wp.Config.IgnoreBloodNumber ) {
                    continue;
                }
                sire_total_length++;
                info_list[ blood.family_line_num ].SireCount++;
            }

            foreach( var info in info_list ) {
                info.SirePercent = (Double)info.SireCount / (Double)sire_total_length * 100.0;
            }
            return info_list;
        }
        private ListViewItem CreateListViewItemByHorseNum( KOEI.WP7_2012.WP7 wp, UInt32 horse_num, ref KOEI.WP7_2012.Datastruct.HChildData data )
        {
            var abl_data = new HAblData();
            var father_data = new HSireData();
            var mother_data = new HDamData();
            var father_blood_data = new HBloodData();
            var mother_blood_data = new HBloodData();
            var father_family_line_data = new HFamilyLineData();
            var owner_ship_data = new HOwnershipChildData();

            wp.HAblTable.GetData( data.abl_num, ref abl_data );
            wp.HSireTable.GetData( data.father_num, ref father_data );
            wp.HDamTable.GetData( data.mother_num, ref mother_data );
            wp.HBloodTable.GetData( father_data.blood_num, ref father_blood_data );
            wp.HBloodTable.GetData( mother_data.blood_num, ref mother_blood_data );
            wp.HFamilyLineTable.GetData( father_blood_data.family_line_num, ref father_family_line_data );

            var age_value = data.age;
            var is_ownership_horse = false;

            var father_name = String.Empty;
            var mother_name = String.Empty;

            var name = this.GetDispName( wp, out father_name, out mother_name, ref data, ref abl_data, ref father_blood_data, ref mother_blood_data );

            var mark = 0u;

            if( data.owner == 41 ) {
                owner_ship_data = new KOEI.WP7_2012.Datastruct.HOwnershipChildData();
                for( var ii=0; ii< wp.HOwnershipRaceTable.RecordCount; ++ii ) {
                    wp.HOwnershipChildTable.GetData( (uint)ii, ref owner_ship_data );
                    if( owner_ship_data.horse_num == horse_num ) {
                        mark = owner_ship_data.mark;
                        is_ownership_horse = true;
                        break;
                    }
                }
            }

            var item = new ListViewItem();

            var is_shizitsu = data.shizitsu_num != wp.Config.NullShizitsuNumber;

            var subparams = new [] {
                new { raw_param = abl_data.power,     seichou = owner_ship_data.seichou_power, },
                new { raw_param = abl_data.syunpatsu, seichou = owner_ship_data.seichou_syunpatsu, },
                new { raw_param = abl_data.konzyou,   seichou = owner_ship_data.seichou_konzyou, },
                new { raw_param = abl_data.zyuunan,   seichou = owner_ship_data.seichou_zyuunan, },
                new { raw_param = abl_data.seishin,   seichou = owner_ship_data.seichou_seishin, },
                new { raw_param = abl_data.kashikosa, seichou = owner_ship_data.seichou_kashikosa, },
                new { raw_param = abl_data.health,    seichou = owner_ship_data.seichou_health, },
            };

            var zyuunan = abl_data.zyuunan + owner_ship_data.seichou_zyuunan / 10;

            if( abl_data.keiro == 9 ) {
                ++this.white_color_horse_;
            }

            var n = 1;
            var subparam_total = 0u;

            item.Text = name;
            item.SubItems[0].Tag = name;

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = Helper.GetCountryByBokuzyouNum( abl_data.bokuzyou ).国().Substring( 0, 1 ),
                Tag = (int)abl_data.bokuzyou,
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = age_value.ToString(),
                Tag = (int)age_value,
            });
            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = data.gender.性別(),
                Tag = (int)data.gender,
            });

            if( is_ownership_horse ) {
                var subparam_seichou_total = 0u;

                __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                    Text = String.Format( "{0}({1})",
                        abl_data.speed + owner_ship_data.seichou_speed,
                        abl_data.speed
                    ).ToString() ,
                    Tag = (int)( abl_data.speed + owner_ship_data.seichou_speed ),
                });
                __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                    Text = abl_data.stamina.ToString(),
                    Tag = (int)abl_data.stamina,
                });

                foreach( var param in subparams ) {
                    var param_value = param.raw_param + param.seichou / 10;
                    __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                        Text = String.Format( "{0}({1,3})", param_value.サブパラ(), "+" + param.seichou.ToString() ),
                        Tag = (int)param_value,
                    });
                    subparam_total += param.raw_param;
                    subparam_seichou_total += param.seichou / 10;
                }

                __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                    Text = String.Format( "{0,2}({1,3})",
                        subparam_total + subparam_seichou_total,
                        "+" + subparam_seichou_total.ToString()
                    ).ToString() ,
                    Tag = (int)subparam_total,
                });
            } else {
                __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                    Text = String.Format( "{0}",
                        abl_data.speed
                    ).ToString() ,
                    Tag = (int)( abl_data.speed ),
                });
                __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                    Text = abl_data.stamina.ToString(),
                    Tag = (int)abl_data.stamina,
                });

                foreach( var param in subparams ) {
                    var param_value = param.raw_param;
                    __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                        Text = String.Format( "{0}", param_value.サブパラ() ),
                        Tag = (int)param_value,
                    });
                    subparam_total += param.raw_param;
                }

                __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                    Text = String.Format( "{0}",
                        subparam_total
                    ).ToString() ,
                    Tag = (int)subparam_total,
                });
            }

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = abl_data.kisyou.気性().Substring(0,1),
                Tag = (int)abl_data.kisyou,
            });
            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = abl_data.babatekisei.馬場適正().Substring(0,1),
                Tag = (int)abl_data.babatekisei,
            });
            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = abl_data.senpou.戦法(),
                Tag = (int)abl_data.senpou,
            });
            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = abl_data.seichougata.成長型(),
                Tag = (int)abl_data.seichougata,
            });
            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = abl_data.seichouryoku.成長力(),
                Tag = (int)abl_data.seichouryoku,
            });
            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = ( 100 + data.seigen ).ToString(),
                Tag = (int)data.seigen,
            });
            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = data.zyumyou.ToString(),
                Tag = (int)data.zyumyou,
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = abl_data.stamina.距離適性( zyuunan ),
                Tag =  abl_data.stamina.距離適性( zyuunan ),
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = abl_data.kodashi.ToString(),
                Tag = (int)abl_data.kodashi,
            });
            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = abl_data.keiro.毛色(),
                Tag = (int)abl_data.keiro,
            });
            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = abl_data.taikou.体高(),
                Tag = (int)abl_data.taikou,
            });
            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = abl_data.zenchou.全長(),
                Tag = (int)abl_data.zenchou,
            });
            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = abl_data.komawari_X.苦手(),
                Tag = (int)abl_data.komawari_X,
            });
            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = data.hidarimawari_X.苦手(),
                Tag = (int)data.hidarimawari_X,
            });
            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = data.migimawari_X.苦手(),
                Tag = (int)data.migimawari_X,
            });
            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = data.weak_point_1.持病(),
                Tag = (int)data.weak_point_1,
            });
            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = data.weak_point_2.持病(),
                Tag = (int)data.weak_point_2,
            });
            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = data.weak_point_3.持病(),
                Tag = (int)data.weak_point_3,
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = abl_data.特性(" "),
                Tag = abl_data.特性二進数(),
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = data.fuda_color.お札(),
                Tag = (int) data.fuda_color,
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = mark.馬印(),
                Tag = (int) mark,
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = String.Format( "{0:N0}", ( data.price2 * 100 ) ),
                Tag = (int) data.price2,
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = String.Format( "{0:N0}", ( data.price * 100 ) ),
                Tag = (int) data.price,
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = father_name,
                Tag = father_name,
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = father_family_line_data.系統名() + "系",
                Tag = father_family_line_data.系統名() + "系",
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = mother_name,
                Tag = mother_name,
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = abl_data.seisankoku.生産国(),
                Tag = (int) abl_data.seisankoku,
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = data.owner.ToString(),
                Tag = (int) data.owner,
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = abl_data.bokuzyou.ToString(),
                Tag = (int) abl_data.bokuzyou,
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = is_shizitsu ? "○" : "",
                Tag = is_shizitsu  ? 1 : 0,
            });

            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = String.Format( "0x{0:X4}", data.shizitsu_num ),
                Tag = (int)data.shizitsu_num,
            });
            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = String.Format( "0x{0:X4}", data.abl_num ),
                Tag = (int)data.abl_num,
            });
            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = String.Format( "0x{0:X4}", horse_num ),
                Tag = (int)horse_num,
                Name = "horse_num",
            });
            __subitems_stack__[n++] = ( new ListViewItem.ListViewSubItem() {
                Text = name,
                Tag = name,
            });

            item.SubItems.AddRange( __subitems_stack__ );

            return item;
        }