public bool Remove(WaypointAsset waypoint)
        {
            bool found;

            WaypointAsset[] newWaypoints;

            found        = false;
            newWaypoints = new WaypointAsset[waypoints.Length - 1];

            for (int i = 0; i < newWaypoints.Length; i++)
            {
                if (waypoints[i] == waypoint)
                {
                    found = true;
                }

                newWaypoints[i] = waypoints[i + ((found) ? 1 : 0)];
            }

            found = (waypoints[newWaypoints.Length] == waypoint) ? true : found;

            if (!found)
            {
                return(false);
            }

            waypoints = newWaypoints;

            return(true);
        }
Пример #2
0
		public WaypointAsset( WaypointAsset original, NetworkAsset network ) : base( network, original.Collection )
		{
			this.Name = original.Name;
			this.Position = original.Position;
			this.radius = original.Radius;
			this.disableRuntime = original.DisableRuntime;
			
			this.Tags = new int[ original.Tags.Length ];
			for( int i = 0; i < original.Tags.Length; i++ )
			// Copy the tag indexes
			{
				this.Tags[ i ] = original.Tags[ i ];
			}
		}
Пример #3
0
        public WaypointAsset(WaypointAsset original, NetworkAsset network) : base(network, original.Collection)
        {
            this.Name           = original.Name;
            this.Position       = original.Position;
            this.radius         = original.Radius;
            this.disableRuntime = original.DisableRuntime;

            this.Tags = new int[original.Tags.Length];
            for (int i = 0; i < original.Tags.Length; i++)
            // Copy the tag indexes
            {
                this.Tags[i] = original.Tags[i];
            }
        }
        public WaypointAsset Add(WaypointAsset waypoint)
        {
            WaypointAsset[] newWaypoints;
            newWaypoints = new WaypointAsset[waypoints.Length + 1];

            for (int i = 0; i < waypoints.Length; i++)
            {
                if (waypoints[i].Name == waypoint.Name)
                {
                    return(null);
                }

                newWaypoints[i] = waypoints[i];
            }

            newWaypoints[waypoints.Length] = waypoint;
            waypoints = newWaypoints;

            return(waypoint);
        }
Пример #5
0
		public bool Remove( WaypointAsset waypoint )
		{
			bool found;
			WaypointAsset[] newWaypoints;
			
			found = false;
			newWaypoints = new WaypointAsset[ waypoints.Length - 1 ];
			
			for( int i = 0; i < newWaypoints.Length; i++ )
			{
				if( waypoints[ i ] == waypoint )
				{
					found = true;
				}

				newWaypoints[ i ] = waypoints[ i + ( ( found ) ? 1 : 0 ) ];
			}
			
			found = ( waypoints[ newWaypoints.Length ] == waypoint ) ? true : found;
			
			if( !found )
			{
				return false;
			}
			
			waypoints = newWaypoints;

			return true;
		}
Пример #6
0
		public WaypointAsset Add( WaypointAsset waypoint )
		{
			WaypointAsset[] newWaypoints;
			newWaypoints = new WaypointAsset[ waypoints.Length + 1 ];
			
			for( int i = 0; i < waypoints.Length; i++ )
			{
				if( waypoints[ i ].Name == waypoint.Name )
				{
					return null;
				}
				
				newWaypoints[ i ] = waypoints[ i ];
			}
			
			newWaypoints[ waypoints.Length ] = waypoint;
			waypoints = newWaypoints;
			
			return waypoint;
		}