예제 #1
0
        public bool Remove(GridNodeAsset node)
        {
            bool found;

            GridNodeAsset[] newNodes;

            found    = false;
            newNodes = new GridNodeAsset[nodes.Length - 1];

            for (int i = 0; i < newNodes.Length; i++)
            {
                if (nodes[i] == node)
                {
                    found = true;
                }

                newNodes[i] = nodes[i + ((found) ? 1 : 0)];
            }

            found = (nodes[newNodes.Length] == node) ? true : found;

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

            nodes = newNodes;

            return(true);
        }
예제 #2
0
        public GridNodeAsset(GridNodeAsset original, NetworkAsset network) : base(network, original.Collection)
        {
            this.Name = original.Name;
            target    = original.Target;

            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 GridNodeAsset( GridNodeAsset original, NetworkAsset network ) : base( network, original.Collection )
		{
			this.Name = original.Name;
			target = original.Target;
			
			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 ];
			}
		}
예제 #4
0
        public GridNodeAsset Add(GridNodeAsset node)
        {
            GridNodeAsset[] newNodes;
            newNodes = new GridNodeAsset[nodes.Length + 1];

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

                newNodes[i] = nodes[i];
            }

            newNodes[nodes.Length] = node;
            nodes = newNodes;

            return(node);
        }
예제 #5
0
		public bool Remove( GridNodeAsset node )
		{
			bool found;
			GridNodeAsset[] newNodes;
			
			found = false;
			newNodes = new GridNodeAsset[ nodes.Length - 1 ];
			
			for( int i = 0; i < newNodes.Length; i++ )
			{
				if( nodes[ i ] == node )
				{
					found = true;
				}

				newNodes[ i ] = nodes[ i + ( ( found ) ? 1 : 0 ) ];
			}
			
			found = ( nodes[ newNodes.Length ] == node ) ? true : found;
			
			if( !found )
			{
				return false;
			}
			
			nodes = newNodes;

			return true;
		}
예제 #6
0
		public GridNodeAsset Add( GridNodeAsset node )
		{
			GridNodeAsset[] newNodes;
			newNodes = new GridNodeAsset[ nodes.Length + 1 ];
			
			for( int i = 0; i < nodes.Length; i++ )
			{
				if( nodes[ i ].Name == node.Name )
				{
					return null;
				}
				
				newNodes[ i ] = nodes[ i ];
			}
			
			newNodes[ nodes.Length ] = node;
			nodes = newNodes;
			
			return node;
		}