當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。