示例#1
0
        public object Clone()
        {
            var s = new BoxSpawn();

            s.m_Count     = m_Count;
            s.m_Extra     = m_Extra;
            s.m_Group     = m_Group;
            s.m_HomeRange = m_HomeRange;
            s.m_MaxDelay  = m_MaxDelay;
            s.m_MinDelay  = m_MinDelay;
            s.m_Name      = m_Name;
            s.m_Team      = m_Team;

            // Issue 10 - Update the code to Net Framework 3.5 - http://code.google.com/p/pandorasbox3/issues/detail?id=10 - Smjert
            s.m_Entries = new List <BoxSpawnEntry>();
            // Issue 10 - End

            foreach (var e in m_Entries)
            {
                // Issue 10 - Update the code to Net Framework 3.5 - http://code.google.com/p/pandorasbox3/issues/detail?id=10 - Smjert
                s.m_Entries.Add(e.Clone() as BoxSpawnEntry);
                // Issue 10 - End
            }

            return(s);
        }
示例#2
0
		/// <summary>
		/// Converts a BoxSpawn to an actual spawner object. This function is used to generate
		/// spawn groups created in Pandora's Box
		/// </summary>
		/// <param name="spawn">The BoxSpawn object describing the spawn that should be created</param>
		/// <returns>A Spawner object - null if not valid</returns>
		public static Item CreateBoxSpawn( BoxSpawn spawn )
		{
			if ( spawn == null || spawn.Entries.Count == 0 )
				return null;

			XmlSpawner spawner = new XmlSpawner();

			spawner.Amount = spawn.Count;
			spawner.MaxCount = spawn.Count;
			spawner.MinDelay = TimeSpan.FromSeconds( spawn.MinDelay );
			spawner.MaxDelay = TimeSpan.FromSeconds( spawn.MaxDelay );
			spawner.Team = spawn.Team;
			spawner.HomeRange = spawn.HomeRange;

			spawner.Running = false;

			spawner.Group = spawn.Group;

			XmlSpawner.SpawnObject[] spawnObjects = new Server.Mobiles.XmlSpawner.SpawnObject[ spawn.Entries.Count ];

			for ( int i = 0; i < spawnObjects.Length; i++ )
			{
				BoxSpawnEntry entry = spawn.Entries[ i ] as BoxSpawnEntry;

				spawnObjects[ i ] = new Server.Mobiles.XmlSpawner.SpawnObject( entry.Type, entry.MaxCount );
			}

			spawner.SpawnObjects = spawnObjects;

			return spawner;
		}
示例#3
0
        public int CompareTo(object obj)
        {
            BoxSpawn cmp = obj as BoxSpawn;

            if (cmp != null)
            {
                return(m_Name.CompareTo(cmp.m_Name));
            }
            else
            {
                return(0);
            }
        }
示例#4
0
		/// <summary>
		/// Converts a BoxSpawn to an actual spawner object. This function is used to generate
		/// spawn groups created in Pandora's Box
		/// </summary>
		/// <param name="spawn">The BoxSpawn object describing the spawn that should be created</param>
		/// <returns>A Spawner object - null if not valid</returns>
		public static Item CreateBoxSpawn( BoxSpawn spawn )
		{
			if ( spawn == null || spawn.Entries.Count == 0 )
				return null;

			Spawner spawner = new Spawner( spawn.Count, spawn.MinDelay, spawn.MaxDelay, spawn.Team, spawn.HomeRange, null );
			spawner.Running = false;

			spawner.Group = spawn.Group;

			foreach ( BoxSpawnEntry entry in spawn.Entries )
			{
				spawner.CreaturesName.Add( entry.Type );
			}

			return spawner;
		}
示例#5
0
        public object Clone()
        {
            BoxSpawn s = new BoxSpawn();

            s.m_Count     = this.m_Count;
            s.m_Extra     = this.m_Extra;
            s.m_Group     = this.m_Group;
            s.m_HomeRange = this.m_HomeRange;
            s.m_MaxDelay  = this.m_MaxDelay;
            s.m_MinDelay  = this.m_MinDelay;
            s.m_Name      = this.m_Name;
            s.m_Team      = this.m_Team;

            s.m_Entries = new ArrayList();

            foreach (BoxSpawnEntry e in this.m_Entries)
            {
                s.m_Entries.Add(e.Clone());
            }

            return(s);
        }
示例#6
0
		/// <summary>
		/// Converts a BoxSpawn to an actual spawner object. This function is used to generate
		/// spawn groups created in Pandora's Box
		/// </summary>
		/// <param name="spawn">The BoxSpawn object describing the spawn that should be created</param>
		/// <returns>A Spawner object - null if not valid</returns>
		public static Item CreateBoxSpawn( BoxSpawn spawn )
		{
			//
			// TODO : Convert the BoxSpawn object to your custom spawner
			// The code below (commented out) shows the implementation of this method
			// for the default Spawner object
			//


/*			if ( spawn == null || spawn.Entries.Count == 0 )
				return null;

			Spawner spawner = new Spawner( spawn.Count, spawn.MinDelay, spawn.MaxDelay, spawn.Team, spawn.HomeRange, null );
			spawner.Running = false;

			spawner.Group = spawn.Group;

			foreach ( BoxSpawnEntry entry in spawn.Entries )
			{
				spawner.CreaturesName.Add( entry.Type );
			}

			return spawner; */
		}
示例#7
0
		/// <summary>
		/// Creates a new SpawnMessage
		/// </summary>
		/// <param name="spawn">The spawn that will be created on the server</param>
		public SpawnMessage( BoxSpawn spawn )
		{
			m_Spawn = spawn;
		}
示例#8
0
		public object Clone()
		{
			BoxSpawn s = new BoxSpawn();

			s.m_Count = this.m_Count;
			s.m_Extra = this.m_Extra;
			s.m_Group = this.m_Group;
			s.m_HomeRange = this.m_HomeRange;
			s.m_MaxDelay = this.m_MaxDelay;
			s.m_MinDelay = this.m_MinDelay;
			s.m_Name = this.m_Name;
			s.m_Team = this.m_Team;

			s.m_Entries = new ArrayList();

			foreach ( BoxSpawnEntry e in this.m_Entries )
			{
				s.m_Entries.Add( e.Clone() );
			}

			return s;
		}
示例#9
0
			public InternalTarget( BoxSpawn spawn ) : base ( -1, true, TargetFlags.None )
			{
				m_Spawn = spawn;
			}
示例#10
0
		public object Clone()
		{
			BoxSpawn s = new BoxSpawn();

			s.m_Count = this.m_Count;
			s.m_Extra = this.m_Extra;
			s.m_Group = this.m_Group;
			s.m_HomeRange = this.m_HomeRange;
			s.m_MaxDelay = this.m_MaxDelay;
			s.m_MinDelay = this.m_MinDelay;
			s.m_Name = this.m_Name;
			s.m_Team = this.m_Team;

			// Issue 10 - Update the code to Net Framework 3.5 - http://code.google.com/p/pandorasbox3/issues/detail?id=10 - Smjert
			s.m_Entries = new List<BoxSpawnEntry>();
			// Issue 10 - End

			foreach ( BoxSpawnEntry e in this.m_Entries )
			{
				// Issue 10 - Update the code to Net Framework 3.5 - http://code.google.com/p/pandorasbox3/issues/detail?id=10 - Smjert
				s.m_Entries.Add( e.Clone() as BoxSpawnEntry );
				// Issue 10 - End
			}

			return s;
		}