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


C# WayPoint.Delete方法代码示例

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


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

示例1: Initialize

		public static void Initialize()
		{
			XmlSpawner.LoadSettings( new XmlSpawner.AssignSettingsHandler( AssignSettings ), "XmlSpawner" );

			// initialize the default waypoint name
			WayPoint tmpwaypoint = new WayPoint();
			if( tmpwaypoint != null )
			{
				defwaypointname = tmpwaypoint.Name;
				tmpwaypoint.Delete();
			}
			// 2004.02.08 :: Omega Red
			// initialize m_Region fields after world load (now, regions are loaded)
			// Now this gets handled in OnTick

			int count = 0;
			int regional = 0;
			//int timercount=0;

			foreach( Item item in World.Items.Values )
			{
				if( item is XmlSpawner )
				{
					count++;
					XmlSpawner spawner = ((XmlSpawner)item);

					if( spawner.RegionName != null && spawner.RegionName != string.Empty )
					{
						spawner.RegionName = spawner.RegionName;	// invoke set(RegionName)
						regional++;
					}

					// check for smart spawning and restart timers after deser if needed
					// note, HasActiveSectors will recalculate the sector list and UseSectorActivate property
					bool recalc_sectors = spawner.HasActiveSectors;
					/*
										if(spawner.SmartSpawning && spawner.IsInactivated && !spawner.UseSectorActivate)
										{
											spawner.DoSectorTimer(TimeSpan.FromSeconds(1));
											timercount++;
										}
					*/
					// add in the totalitem mod to keep them from adding to container counts
					//spawner.TotalItems = -1;
					//spawner.UpdateTotal(spawner, TotalType.Items, -1);

					spawner.RestoreISpawner();
				}
			}

			// start the global smartspawning timer
			if( SmartSpawningSystemEnabled )
			{
				DoGlobalSectorTimer( TimeSpan.FromSeconds( 1 ) );
			}

			// standard commands
			CommandSystem.Register( "XmlSpawnerShowAll", AccessLevel.Administrator, new CommandEventHandler( ShowSpawnPoints_OnCommand ) );
			CommandSystem.Register( "XmlSpawnerHideAll", AccessLevel.Administrator, new CommandEventHandler( HideSpawnPoints_OnCommand ) );
			CommandSystem.Register( "XmlSpawnerWipe", AccessLevel.Administrator, new CommandEventHandler( Wipe_OnCommand ) );
			CommandSystem.Register( "XmlSpawnerWipeAll", AccessLevel.Administrator, new CommandEventHandler( WipeAll_OnCommand ) );
			CommandSystem.Register( "XmlSpawnerLoad", DiskAccessLevel, new CommandEventHandler( Load_OnCommand ) );
			CommandSystem.Register( "XmlSpawnerSave", DiskAccessLevel, new CommandEventHandler( Save_OnCommand ) );
			CommandSystem.Register( "XmlSpawnerSaveAll", DiskAccessLevel, new CommandEventHandler( SaveAll_OnCommand ) );
			//added respawn commands
			CommandSystem.Register( "XmlSpawnerRespawn", AccessLevel.Administrator, new CommandEventHandler( Respawn_OnCommand ) );
			CommandSystem.Register( "XmlSpawnerRespawnAll", AccessLevel.Administrator, new CommandEventHandler( RespawnAll_OnCommand ) );

			// ok, I'm lazy. I dont like all that typing, so these are two aliases for the longer commands
			CommandSystem.Register( "XmlShow", AccessLevel.Administrator, new CommandEventHandler( ShowSpawnPoints_OnCommand ) );
			CommandSystem.Register( "XmlHide", AccessLevel.Administrator, new CommandEventHandler( HideSpawnPoints_OnCommand ) );

			CommandSystem.Register( "XmlHome", AccessLevel.GameMaster, new CommandEventHandler( XmlHome_OnCommand ) );
			CommandSystem.Register( "XmlUnLoad", DiskAccessLevel, new CommandEventHandler( UnLoad_OnCommand ) );
			CommandSystem.Register( "XmlSpawnerUnLoad", DiskAccessLevel, new CommandEventHandler( UnLoad_OnCommand ) );
			CommandSystem.Register( "XmlLoad", DiskAccessLevel, new CommandEventHandler( Load_OnCommand ) );
			//CommandSystem.Register( "XmlLoadHere", DiskAccessLevel, new CommandEventHandler( LoadHere_OnCommand ) );
			//CommandSystem.Register( "XmlNewLoad", DiskAccessLevel, new CommandEventHandler( NewLoad_OnCommand ) );
			//CommandSystem.Register( "XmlNewLoadHere", DiskAccessLevel, new CommandEventHandler( NewLoadHere_OnCommand ) );
			CommandSystem.Register( "XmlSave", DiskAccessLevel, new CommandEventHandler( Save_OnCommand ) );
			CommandSystem.Register( "XmlSaveAll", DiskAccessLevel, new CommandEventHandler( SaveAll_OnCommand ) );
			//CommandSystem.Register( "XmlSaveOld", DiskAccessLevel, new CommandEventHandler( SaveOld_OnCommand ) );
			//CommandSystem.Register( "XmlImportSpawners", DiskAccessLevel, new CommandEventHandler( XmlImportSpawners_OnCommand ) );
			//CommandSystem.Register( "XmlImportMSF", DiskAccessLevel, new CommandEventHandler( XmlImportMSF_OnCommand ) );
			//CommandSystem.Register( "XmlImportMap", DiskAccessLevel, new CommandEventHandler( XmlImportMap_OnCommand ) );
			//CommandSystem.Register( "XmlDefaults", AccessLevel.Administrator, new CommandEventHandler( XmlDefaults_OnCommand ) );
			//CommandSystem.Register( "XmlGet", AccessLevel.GameMaster, new CommandEventHandler( XmlGetValue_OnCommand ) );
			//TargetCommands.Register( new XmlSetCommand() );
			//CommandSystem.Register( "XmlSet", AccessLevel.GameMaster, new CommandEventHandler( XmlSetValue_OnCommand ) );
			//CommandSystem.Register( "OptimalSmartSpawning", AccessLevel.Administrator, new CommandEventHandler( OptimalSmartSpawning_OnCommand ) );
			//CommandSystem.Register( "SmartStat", AccessLevel.GameMaster, new CommandEventHandler( SmartStat_OnCommand ) );
			//CommandSystem.Register( "XmlGo", AccessLevel.GameMaster, new CommandEventHandler( SpawnEditorGo_OnCommand ) );
			//CommandSystem.Register( "TagList", AccessLevel.Administrator, new CommandEventHandler( ShowTagList_OnCommand ) );

#if(TRACE)
			CommandSystem.Register( "XmlMake", AccessLevel.Administrator, new CommandEventHandler( XmlMake_OnCommand ) );
			CommandSystem.Register( "XmlTrace", AccessLevel.Administrator, new CommandEventHandler( XmlTrace_OnCommand ) );
			CommandSystem.Register( "XmlResetTrace", AccessLevel.Administrator, new CommandEventHandler( XmlResetTrace_OnCommand ) );
#endif

//.........这里部分代码省略.........
开发者ID:greeduomacro,项目名称:hubroot,代码行数:101,代码来源:XmlSpawner2.cs


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