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 HChildData CommandMain( WP7 wp, UInt32 horse_num, HChildData data )
    {
        var abl_data = new HAblData();

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

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

        return data;
    }
    public static HChildData CommandMain( WP7 wp, UInt32 horse_num, HChildData 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;
    }
    public static HChildData CommandMain( WP7 wp, UInt32 horse_num, HChildData data )
    {
        data.seigen = 10;

        return data;
    }
    public static HChildData CommandMain( WP7 wp, UInt32 horse_num, HChildData data )
    {
        if( is_cancel == true ) {
            return data;
        }
        var dam_data = new HDamData();
        wp.HDamTable.GetData( data.mother_num, ref dam_data );

        var form = new DispBloodLineForm( wp, dam_data.blood_num );

        if( form.ShowDialog() == DialogResult.No ) {
            is_cancel = true;
        }
        return data;
    }
        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;
        }
        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;
        }
 /// <summary>
 /// データを更新してフォームを描画しなおす
 /// </summary>
 /// <param name="item_index">リストビューのアイテムインデックス</param>
 /// <param name="horse_num">馬番号</param>
 /// <param name="data">馬データ</param>
 private void DataUpdateAndRefresh( int item_index, UInt32 horse_num, ref HChildData data )
 {
     this.__subitems_stack__ = new ListViewItem.ListViewSubItem[ DefaultColumnHeaders.Length ];
     this.ListView1_VirtualItems[item_index] = this.CreateListViewItemByHorseNum( this.WP7, horse_num, ref data );
     this.ListView1_OddColor();
     this.ListView1.Refresh();
 }
        /// <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 );
                }
            }
        }
示例#10
0
        protected override void ExecCSharpExtension( System.Reflection.MethodInfo method, WP7_2012ULV.Setting.ExtensionSetting.Manifest manifest )
        {
            var data = new KOEI.WP7_2012.Datastruct.HChildData();

            SelectedItemsEach( ( item_index, horse_num ) => {
                this.WP7.HChildTable.GetData( horse_num, ref data );

                var args = new object[]{
                    this.WP7,
                    horse_num,
                    data
                };
                data = (KOEI.WP7_2012.Datastruct.HChildData) method.Invoke( null, args );

                if( this.Mode == ReadWriteMode.ReadWrite && manifest.Mode == ReadWriteMode.ReadWrite ) {
                    this.WP7.HChildTable.SetData( horse_num, ref data );
                    this.WP7.HChildTable.Commit( horse_num );

                    this.ListView1_VirtualItems[ item_index ] = this.CreateListViewItemByHorseNum( this.WP7, horse_num, ref data );
                }
            });
            this.ListView1.Refresh();
            this.ListView1_OddColor();
        }
示例#11
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();
        }