public GameResource(string filename, Location location, ResourceType type)
{
if (!string.IsNullOrWhiteSpace(filename))
this.FileInfo = new FileInfo(filename);
this.Location = location;
if (type == ResourceType.Unknown)
{
// Try to determine type based off file extension
string ext = "*" + Path.GetExtension(filename);
if (Constants.IMAGEFILTERS.Split('|').Contains(ext)) type = ResourceType.Graphics;
else if (Constants.AUDIOFILTERS.Split('|').Contains(ext)) type = ResourceType.Audio;
}
this.ResourceType = type;
}