Tuesday, May 16, 2006

Finally! .NET 2.0 Directory Search Improvements

This may seem insignificant to most, but I was thrilled to see that Microsoft added a static method overload to the Directory.GetFiles() method to include a recursive "SearchOption", which specifies whether the search should return files in only the current directory or search through all subdirectories as well.

public static string[] GetFiles (
string path,
string searchPattern,
SearchOption searchOption
)


But, before I got too excited, I found they still don't allow multiple search patterns. You must make a call for each pattern you are searching for. :-(

Still, this improvement saves having to write or reuse that recursive directory search function you've been using forever. It also allows for quick and easy accumulation of files into a collection. For example:
           
ArrayList files = new ArrayList();
try
{
files.AddRange(Directory.GetFiles(@"C:\", "*.jpg",
SearchOption.AllDirectories));
files.AddRange(Directory.GetFiles(@"C:\", "*.bmp",
SearchOption.AllDirectories));
files.AddRange(Directory.GetFiles(@"C:\", "*.tif?",
SearchOption.AllDirectories));
}
catch (UnauthorizedAccessException expectedException)
{
}

As small as this change seems, it's a welcome change!

Terry

Saturday, May 13, 2006

Sin Episodes


Well, I took the plunge and bought Sin Episodes : Emergence off of Steam. Mostly because I loved the first Sin game and was curious to see if this team could do it again. Other than the length and the cost, it wasn't too bad, but it had lost the character and attitude of the first Sin game. :-( If the "episode" were only $10, I would say it's a good buy for the money, but at $20, it's just lacking enough content to make it feel like you got your money's worth. I did enjoy the last series of levels - the way you climb the building and slowly make your way to the top was a lot of fun. I don't know if Levelord made that level or not, but I wouldn't be surprised. In Sin, Levelord continually made top-notch, creative levels doing stuff that nobody else had done before. I played deathmatch for hours on "Behind Zee Bookcase". Great stuff!

Elexis is a little *too* sexy, though. The first game, she was meant to be sexy, but still look like a mean bitch. In this version, she just doesn't look mean. Hard to take her seriously as a villian when she looks like a bimbo sex kitten. (No, she doesn't have some strange skin disease. In the scene this was captured from, she was appearing to Blade as a hologram, so there's some funky video effect)

w00t

w00t! I have a blog! ;-)