当前位置: 首页>>代码示例>>C#>>正文


C# MegaSpawner.ConvertOldSettings方法代码示例

本文整理汇总了C#中Server.Items.MegaSpawner.ConvertOldSettings方法的典型用法代码示例。如果您正苦于以下问题:C# MegaSpawner.ConvertOldSettings方法的具体用法?C# MegaSpawner.ConvertOldSettings怎么用?C# MegaSpawner.ConvertOldSettings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Server.Items.MegaSpawner的用法示例。


在下文中一共展示了MegaSpawner.ConvertOldSettings方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Deserialize


//.........这里部分代码省略.........
                                case Setting.AddContainer:
                                {
                                    List.Add( reader.ReadString() );
                                    List.Add( reader.ReadInt() );
                                    List.Add( reader.ReadString() );
                                    List.Add( reader.ReadInt() );
                                    List.Add( reader.ReadInt() );

                                    int settingCount = reader.ReadInt();

                                    for ( int j = 6; j < settingCount; j++ )
                                    {
                                        ArrayList ItemsList = new ArrayList();

                                        ItemsList.Add( reader.ReadString() );
                                        ItemsList.Add( reader.ReadInt() );
                                        ItemsList.Add( reader.ReadInt() );

                                        List.Add( ItemsList );
                                    }

                                    break;
                                }
                            }

                            megaSpawner.SettingsList.Add( List );
                        }
                    }
                    else
                    {
                        for ( int i = 0; i < settingsCount; i++ )
                            megaSpawner.SettingsList.Add( reader.ReadString() );

                        megaSpawner.ConvertOldSettings();
                    }
                }

                if ( megaSpawner.Workspace )
                {
                    megaSpawner.Delete();
                }
                else
                {
                    megaSpawner.MoveToWorld( location, map );
                    megaSpawner.Start();

                    if ( megaSpawner.Imported != "" )
                        MC.FileImportAdd( megaSpawner.Imported, megaSpawner.ImportVersion );

                    megaSpawner.CompileSettings();
                    megaSpawner.CheckEntryErrors();

                    megaSpawner.SettingsList.Sort( new MC.SettingsSorter() );

                    if ( megaSpawner.OverrideIndividualEntries )
                    {
                        for ( int i = 0; i < megaSpawner.OverrideAmount; i++ )
                        {
                            megaSpawner.OverrideRespawnEntryList.Add( "" );
                            megaSpawner.OverrideRespawnTimeList.Add( 0 );
                            megaSpawner.OverrideSpawnCounterList.Add( DateTime.Now );
                            megaSpawner.OverrideSpawnTimeList.Add( 0 );
                            megaSpawner.OverrideDespawnTimeList.Add( 0 );
                        }
                    }
                    else
开发者ID:cynricthehun,项目名称:UOLegends,代码行数:67,代码来源:BackupSystem.cs

示例2: ImportMegaSpawner


//.........这里部分代码省略.........
                                {
                                    foreach ( XmlElement contItem in contList.GetElementsByTagName( "ContainerItem" ) )
                                    {
                                        ArrayList ItemsList = new ArrayList();

                                        try{ ItemsList.Add( GetInnerText( contItem["AddItem"] ) ); }
                                        catch{ errors++; totalErrors++; }

                                        try{ ItemsList.Add( int.Parse( GetInnerText( contItem["MinStackAmount"] ) ) ); }
                                        catch{ errors++; totalErrors++; }

                                        try{ ItemsList.Add( int.Parse( GetInnerText( contItem["MaxStackAmount"] ) ) ); }
                                        catch{ errors++; totalErrors++; }

                                        List.Add( ItemsList );
                                    }
                                }
                                catch{}

                                if ( err == errors )
                                    megaSpawner.SettingsList.Add( List );
                            }
                        }
                        catch{}
                    }
                    else
                    {
                        foreach ( XmlElement setting in settingsList.GetElementsByTagName( "Setting" ) )
                        {
                            try{ megaSpawner.SettingsList.Add( setting.InnerText ); }
                            catch{ errors++; totalErrors++; }
                        }

                        megaSpawner.ConvertOldSettings();
                    }
                }

                if ( errors > 0 )
                {
                    megaSpawner.Delete();

                    amountOfSpawners--;
                }
                else
                {
                    megaSpawner.MoveToWorld( location, map );

                    if ( location.Z == -999 )
                        megaSpawner.Location = GetLocation( megaSpawner, location );

                    if ( megaSpawner.Location.Z == -999 )
                    {
                        megaSpawner.Delete();

                        amountOfSpawners--;
                        autoFailures++;

                        return;
                    }

                    megaSpawner.CheckDupedSettings();
                    megaSpawner.CompileSettings();

                    megaSpawner.SettingsList.Sort( new MC.SettingsSorter() );

                    if ( megaSpawner.OverrideIndividualEntries )
开发者ID:cynricthehun,项目名称:UOLegends,代码行数:67,代码来源:LoadFileGump.cs


注:本文中的Server.Items.MegaSpawner.ConvertOldSettings方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。