using System;
using System.Runtime.InteropServices;

namespace SharpQuake
{
	[StructLayout(LayoutKind.Sequential, Pack = 1)]
	internal class dfunction_t
	{
		public string FileName
		{
			get
			{
				return progs.GetString(this.s_file);
			}
		}

		public string Name
		{
			get
			{
				return progs.GetString(this.s_name);
			}
		}

		public void SwapBytes()
		{
			this.first_statement = common.LittleLong(this.first_statement);
			this.parm_start = common.LittleLong(this.parm_start);
			this.locals = common.LittleLong(this.locals);
			this.s_name = common.LittleLong(this.s_name);
			this.s_file = common.LittleLong(this.s_file);
			this.numparms = common.LittleLong(this.numparms);
		}

		public override string ToString()
		{
			return string.Format("{{{0}: {1}()}}", this.FileName, this.Name);
		}

		public int first_statement;

		public int parm_start;

		public int locals;

		public int profile;

		public int s_name;

		public int s_file;

		public int numparms;

		[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
		public byte[] parm_size;

		public static int SizeInBytes = Marshal.SizeOf(typeof(dfunction_t));
	}
}
