Exemplo n.º 1
1
 /// <summary>
 /// コンストラクタ
 /// </summary>
 /// <param name="country">地域</param>
 /// <param name="family_line_num">系統番号</param>
 /// <param name="parent_family_line_num">大元の親系統番号</param>
 /// <param name="data">系統データ</param>
 public FamilyLineInfo( Horse.Area country, UInt32 family_line_num, UInt32 parent_family_line_num, ref HFamilyLineData data )
 {
     this.Coutry = country;
     this.FamilyLineNum = family_line_num;
     this.ParentFamilyLuneNum = parent_family_line_num;
     this.Data = data;
 }
Exemplo n.º 2
0
        /// <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;
        }
Exemplo n.º 3
0
        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;
        }
Exemplo n.º 4
0
        /// <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 );
                }
            }
        }
Exemplo n.º 5
0
        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;
        }
        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;
        }
Exemplo n.º 7
0
        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;
        }