Server.Commands.DecorationList.Generate C# (CSharp) Méthode

Generate() public méthode

public Generate ( Server.Map maps ) : int
maps Server.Map
Résultat int
		public int Generate( Map[] maps )
		{
			int count = 0;

			Item item = null;

			for ( int i = 0; i < m_Entries.Count; ++i )
			{
				DecorationEntry entry = (DecorationEntry)m_Entries[i];
				Point3D loc = entry.Location;
				string extra = entry.Extra;

				for ( int j = 0; j < maps.Length; ++j )
				{
					if ( item == null )
						item = Construct();

					if ( item == null )
						continue;

					if ( FindItem( loc.X, loc.Y, loc.Z, maps[j], item ) )
					{
					}
					else
					{
						item.MoveToWorld( loc, maps[j] );
						++count;

						if ( item is BaseDoor )
						{
							IPooledEnumerable eable = maps[j].GetItemsInRange( loc, 1 );

							Type itemType = item.GetType();

							foreach ( Item link in eable )
							{
								if ( link != item && link.Z == item.Z && link.GetType() == itemType )
								{
									((BaseDoor)item).Link = (BaseDoor)link;
									((BaseDoor)link).Link = (BaseDoor)item;
									break;
								}
							}

							eable.Free();
						}

						item = null;
					}
				}
			}

			if ( item != null )
				item.Delete();

			return count;
		}