namespace FSO.Common.Content
{
///
/// Represents the ID of a content resource.
/// Consists of two parts: TypeID (uint) and FileID (uint).
///
public class ContentID
{
public uint TypeID;
public uint FileID;
public string FileName;
private long v;
///
/// Creates a new ContentID instance.
///
/// The TypeID of the content resource.
/// The FileID of the content resource.
public ContentID(uint typeID, uint fileID)
{
this.TypeID = typeID;
this.FileID = fileID;
}
public ContentID(string name)
{
this.FileName = name;
}
public ContentID(long v)
{
this.TypeID = (uint)v;
this.FileID = (uint)(v >> 32);
}
public ulong Shift()
{
var fileIDLong = ((ulong)FileID) << 32;
return fileIDLong | TypeID;
}
}
}