namespace Decal.Filters;

public sealed class GenderTable : IdNameTable<Gender>
{
	internal GenderTable(byte[] Data)
	{
		LoadFrom(Data);
	}

	internal override bool LoadFrom(byte[] Data)
	{
		int Index = 0;
		if (Get.DWord(Data, ref Index) != 570425354)
		{
			return false;
		}
		Index += 5;
		int num = Get.Byte(Data, ref Index);
		InitializeTable(num);
		for (int i = 0; i < num; i++)
		{
			Gender gender = new Gender(Get.DWord(Data, ref Index));
			gender.Name = Get.PString(Data, ref Index);
			Add(gender);
		}
		return true;
	}
}
