public static HChildData CommandMain( WP7 wp, UInt32 horse_num, HChildData data )
    {
        var abl_data = new HAblData();

        if( is_cancel == true ) {
            return data;
        }
        if( is_first_call == true ) {
            if( MessageBox.Show( "メモリを書き換えますよろしいですか?", "確認", MessageBoxButtons.OKCancel, MessageBoxIcon.Question ) == DialogResult.Cancel ) {
                is_cancel = true;
                return data;
            }
            is_first_call = false;
        }

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

        abl_data.speed     = 85;
        abl_data.health    = 3; // 健康
        abl_data.power     = 3; // パワー
        abl_data.zyuunan   = 3; // 柔軟性
        abl_data.syunpatsu = 3; // 瞬発力
        abl_data.konzyou   = 3; // 勝負根性
        abl_data.kashikosa = 3; // 賢さ
        abl_data.seishin   = 3; // 精神力

        wp.HAblTable.SetData( data.abl_num, ref abl_data );
        wp.HAblTable.Commit( data.abl_num );

        data.seigen = 10;

        return data;
    }
    public static HSireData CommandMain( WP7 wp, UInt32 horse_num, HSireData data )
    {
        var abl_data = new HAblData();

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

        if( abl_data.kodashi > 0 ) {
            abl_data.kodashi--;
            wp.HAblTable.SetData( data.abl_num, ref abl_data );
            wp.HAblTable.Commit( data.abl_num );
        }
        return data;
    }
    public static HSireData CommandMain( WP7 wp, UInt32 horse_num, HSireData data )
    {
        var abl_data = new HAblData();

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

        abl_data.bokuzyou = 27;

        wp.HAblTable.SetData( data.abl_num, ref abl_data );
        wp.HAblTable.Commit( data.abl_num );

        return data;
    }
    public static HDamData CommandMain( WP7 wp, UInt32 horse_num, HDamData data )
    {
        var abl_data = new HAblData();

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

        abl_data.kodashi = 0;

        wp.HAblTable.SetData( data.abl_num, ref abl_data );
        wp.HAblTable.Commit( data.abl_num );

        return data;
    }
    public static HRaceData CommandMain( WP7 wp, UInt32 horse_num, HRaceData data )
    {
        var abl_data = new HAblData();

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

        if( abl_data.kisyou < 4 ) {
            abl_data.kisyou += 1;
        }
        wp.HAblTable.SetData( data.abl_num, ref abl_data );
        wp.HAblTable.Commit( data.abl_num );

        return data;
    }
    public static HRaceData CommandMain( WP7 wp, UInt32 horse_num, HRaceData data )
    {
        var abl_data = new HAblData();

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

        if( abl_data.komawari_X != 0 ) {
            abl_data.komawari_X = 0;
            wp.HAblTable.SetData( data.abl_num, ref abl_data );
            wp.HAblTable.Commit( data.abl_num );
        }
        data.migimawari_X   = 0;
        data.hidarimawari_X = 0;
        data.weak_point_1   = 0;
        data.weak_point_2   = 0;
        data.weak_point_3   = 0;

        return data;
    }
示例#7
0
        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;
        }
示例#8
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;
        }
示例#9
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 );
                }
            }
        }
示例#10
0
        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();
        }
示例#11
0
        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;
        }
示例#12
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.HRaceData();
            var abl_data = new KOEI.WP7_2012.Datastruct.HAblData();

            this.WP7.HRaceTable.GetData( horse_num, ref data );
            this.WP7.HAblTable.GetData( data.abl_num, ref abl_data );

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

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

            var form = new SpoilerLikeEditForm() {
                Text = String.Format( "{0} 編集中 - SpoilerALライク編集(β)", this.WP7.馬名( name_type, data.name_left, data.name_right ) ),
                Size = new System.Drawing.Size( 700, 800 ),
            };

            // 競走馬データの編集コントロール
            var data_editor = new SpoilerLikeControls.BitCheckList( this.WP7, HRaceData.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 HRaceData();
                    temp_data.Encode( new_data );
                    this.WP7.HRaceTable.SetData( horse_num, ref temp_data );
                    this.WP7.HRaceTable.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 );
                },
            };

            form.TabPageAdd( "能力データ", new Control[]{ abl_data_editor } );
            form.TabPageAdd( "競走馬データ", new Control[]{ data_editor } );

            if( form.ShowDialog() == DialogResult.Cancel ) {
                if( this.WP7.TransactionWeekNumber == this.WP7.GetCurrentWeekNumber() ) {
                    this.WP7.HRaceTable.SetData( horse_num, ref data );
                    this.WP7.HRaceTable.Commit( horse_num );
                    this.WP7.HAblTable.SetData( data.abl_num, ref abl_data );
                    this.WP7.HAblTable.Commit( data.abl_num );
                    this.DataUpdateAndRefresh( item_index, horse_num, ref data );
                }
            }
        }
示例#13
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;
        }
示例#14
0
        private Boolean IsViewRecord( WP7 wp, UInt32 horse_num, ref HDamData data, ref HAblData abl_data )
        {
            if( !this.ListViewConfig.Status_Intai && data.intai != 0 ) {
                return false;
            }
            if( !this.ListViewConfig.Status_Geneki && data.intai == 0 ) {
                return false;
            }

            if( this.ListViewConfig.OwnerHorse || this.ListViewConfig.ClubHorse  ) {
                switch( abl_data.bokuzyou )
                {
                case 25:
                case 27:
                case 28:
                    if( !this.ListViewConfig.OwnerHorse )
                        return false;
                    break;
                case 26:
                    if( !this.ListViewConfig.ClubHorse )
                        return false;
                    break;
                default:
                    return false;
                }
            }

            var country = Helper.GetCountryByBokuzyouNum( abl_data.bokuzyou );

            switch( country )
            {
            case Enums.CountryType.JAPAN:
                if( !this.ListViewConfig.Country_JAPAN )
                    return false;
                break;
            case Enums.CountryType.USA:
                if( !this.ListViewConfig.Country_USA )
                    return false;
                break;
            case Enums.CountryType.EURO:
                if( !this.ListViewConfig.Country_EURO )
                    return false;
                break;
            default:
                throw new Exception("[BUG]");
            }

            return true;
        }
示例#15
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;
        }
示例#16
0
        private Boolean IsViewRecord( WP7 wp, UInt32 horse_num, ref HChildData data, ref HAblData abl_data )
        {
            if( data.abl_num == wp.Config.NullAbilityNumber ) {
                return false;
            }

            // セリ馬
            if( this.ListViewConfig.SaleHorse ) {
                return data.owner == 43;
            }

            switch( data.age )
            {
            case 0:
                if( !this.ListViewConfig.Age_0 )
                    return false;
                break;
            case 1:
                if( !this.ListViewConfig.Age_1 )
                    return false;
                break;
            default:
                throw new Exception("[BUG]");
            }

            if( this.ListViewConfig.OwnerHorse || this.ListViewConfig.ClubHorse ) {
                switch( data.owner )
                {
                case 41:
                    if( !this.ListViewConfig.OwnerHorse )
                        return false;
                    break;
                case 42:
                    if( !this.ListViewConfig.ClubHorse )
                        return false;
                    break;
                default:
                    return false;
                }
            }

            var country = Helper.GetCountryByBokuzyouNum( abl_data.bokuzyou );

            switch( country )
            {
            case Enums.CountryType.JAPAN:
                if( !this.ListViewConfig.Country_JAPAN )
                    return false;
                break;
            case Enums.CountryType.USA:
                if( !this.ListViewConfig.Country_USA )
                    return false;
                break;
            case Enums.CountryType.EURO:
                if( !this.ListViewConfig.Country_EURO )
                    return false;
                break;
            default:
                throw new Exception("[BUG]");
            }
            return true;
        }
示例#17
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 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;
        }
        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;
        }
        /// <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();
        }
示例#21
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;
        }
示例#22
0
        protected override ListViewItem[] CreateHorseListSub( KOEI.WP7_2012.WP7 wp, object arg )
        {
            this.__subitems_stack__ = new ListViewItem.ListViewSubItem[ DefaultColumnHeaders.Length ];

            var data = new KOEI.WP7_2012.Datastruct.HChildData();
            var abl_data = new KOEI.WP7_2012.Datastruct.HAblData();

            var items = new List< ListViewItem >();

            this.white_color_horse_ = 0;

            if( this.ListViewConfig.CurrentHorse ) {
                var n = wp.GetCurrentCharacterNumber();
                wp.HChildTable.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.HorseChildTable.RecordMaxLength; ++i )
            {
                var horse_num = (uint)i;

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

                if( !this.IsViewRecord( wp, horse_num, ref data, ref abl_data ) ) {
                    continue;
                }
                items.Add( this.CreateListViewItemByHorseNum( wp, horse_num, ref data ) );
            }
            return items.ToArray();
        }