public static HSireData CommandMain( WP7 wp, UInt32 horse_num, HSireData data )
 {
     if( data.age > 0 ) {
         data.age--;
     }
     return data;
 }
    public static HSireData CommandMain( WP7 wp, UInt32 horse_num, HSireData 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     = 45;
        abl_data.health    = 0; // 健康
        abl_data.power     = 0; // パワー
        abl_data.zyuunan   = 0; // 柔軟性
        abl_data.syunpatsu = 0; // 瞬発力
        abl_data.konzyou   = 0; // 勝負根性
        abl_data.kashikosa = 0; // 賢さ
        abl_data.seishin   = 0; // 精神力

        abl_data.kodashi   = 0; // 子出し

        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 )
 {
     if( data.age < HSireData.age_MAXVALUE ) {
         data.age++;
     }
     return data;
 }
Пример #4
0
        /// <summary>
        /// コンストラクタ
        /// </summary>
        /// <param name="wp">WP7</param>
        /// <param name="horseNum">馬番号</param>
        /// <param name="type">血統タイプ 父系or母系</param>
        public Pedigree( WP7 wp, UInt32 horseNum, 血統タイプ type )
        {
            this.wp = wp;
            this.Type = type;
            this.HorseNum = horseNum;

            switch( type ) {
            case 血統タイプ.父系:
                var sire_data = new HSireData();
                this.wp.HSireTable.GetData( this.HorseNum, ref sire_data );
                this.BloodNum = sire_data.blood_num;
                break;
            case 血統タイプ.母系:
                var dam_data = new HDamData();
                this.wp.HDamTable.GetData( this.HorseNum, ref dam_data );
                this.BloodNum = dam_data.blood_num;
                break;
            }
            this.Tree = new Node( wp, type, 0, this.BloodNum, new 血統タイプ[]{ type } );
            this.CreateTree( this.Tree );

            var list = new List< NodeLevelPair >();

            foreach( var node in this.NodeList() ) {
                list.Add( new NodeLevelPair( node.NodeLevel, node ) );
            }
            this.NodeAndLevelList = list.ToArray();
        }
    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 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 blood_data = new HBloodData();

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

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

        return data;
    }
Пример #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;
        }
    public static HSireData CommandMain( WP7 wp, UInt32 horse_num, HSireData data )
    {
        data.bookfull = 0;

        return data;
    }
Пример #10
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;
        }
Пример #11
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;
        }
Пример #12
0
        private Boolean IsViewRecord( WP7 wp, UInt32 horse_num, ref HSireData 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;
        }
Пример #13
0
        /// <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();
        }
Пример #14
0
        private void ListView1_SelectedIndexChangedHandler( object sender, EventArgs e )
        {
            if( this.breedingTargetListView.ListView1.SelectedIndices.Count == 0 ) {
                return ;
            }
            var n = this.breedingTargetListView.ListView1.SelectedIndices[0];
            var item = this.breedingTargetListView.ListView1.Items[n];

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

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

            var horse_name = this.GetDispName( ref blood_data );

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

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

                var form = this.FindForm() as BreedingForm;
                if( form != null ) {
                    form.UpdateToolStripStatusLabel1Text( String.Format( "{0}(ms)", sw.ElapsedMilliseconds ) );
                    form.UpdateToolStripStatusLabel2Text( String.Format( "{0}(line)", this.breedingPartnerListView.ItemsCount ) );
                    form.UpdateToolStripStatusLabel3Text( String.Format( "{0}", horse_name ) );
                }
            } catch( Exception ex ) {
                sw.Stop();
                var message = String.Format( "エラーが発生しました - {0}", ex.Message );
                MessageBox.Show( message, "エラー", MessageBoxButtons.OK, MessageBoxIcon.Error );
            }
        }
Пример #15
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;
                    }
                }
            }
        }
Пример #16
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;
        }
Пример #17
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.HChildData();
            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();

            this.WP7.HChildTable.GetData( horse_num, ref data );
            this.WP7.HAblTable.GetData( data.abl_num, ref abl_data );
            this.WP7.HSireTable.GetData( data.father_num, ref father_data );
            this.WP7.HDamTable.GetData( data.mother_num, ref mother_data );
            this.WP7.HBloodTable.GetData( father_data.blood_num, ref father_blood_data );
            this.WP7.HBloodTable.GetData( mother_data.blood_num, ref mother_blood_data );
            this.WP7.HFamilyLineTable.GetData( father_blood_data.family_line_num, ref father_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 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, HChildData.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 HChildData();
                    temp_data.Encode( new_data );
                    this.WP7.HChildTable.SetData( horse_num, ref temp_data );
                    this.WP7.HChildTable.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.HChildTable.SetData( horse_num, ref data );
                    this.WP7.HChildTable.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 );
                }
            }
        }