using System;
using OpenTK;

namespace SharpQuake
{
	internal class client_state_t
	{
		public bool HasItems(int item)
		{
			return (this.items & item) == item;
		}

		public void Clear()
		{
			this.movemessages = 0;
			this.cmd.Clear();
			Array.Clear(this.stats, 0, this.stats.Length);
			this.items = 0;
			Array.Clear(this.item_gettime, 0, this.item_gettime.Length);
			this.faceanimtime = 0f;
			cshift_t[] array = this.cshifts;
			for (int i = 0; i < array.Length; i++)
			{
				array[i].Clear();
			}
			array = this.prev_cshifts;
			for (int i = 0; i < array.Length; i++)
			{
				array[i].Clear();
			}
			this.mviewangles[0] = Vector3.Zero;
			this.mviewangles[1] = Vector3.Zero;
			this.viewangles = Vector3.Zero;
			this.mvelocity[0] = Vector3.Zero;
			this.mvelocity[1] = Vector3.Zero;
			this.velocity = Vector3.Zero;
			this.punchangle = Vector3.Zero;
			this.idealpitch = 0f;
			this.pitchvel = 0f;
			this.nodrift = false;
			this.driftmove = 0f;
			this.laststop = 0.0;
			this.viewheight = 0f;
			this.crouch = 0f;
			this.paused = false;
			this.onground = false;
			this.inwater = false;
			this.intermission = 0;
			this.completed_time = 0;
			this.mtime[0] = 0.0;
			this.mtime[1] = 0.0;
			this.time = 0.0;
			this.oldtime = 0.0;
			this.last_received_message = 0f;
			Array.Clear(this.model_precache, 0, this.model_precache.Length);
			Array.Clear(this.sound_precache, 0, this.sound_precache.Length);
			this.levelname = null;
			this.viewentity = 0;
			this.maxclients = 0;
			this.gametype = 0;
			this.worldmodel = null;
			this.free_efrags = null;
			this.num_entities = 0;
			this.num_statics = 0;
			this.viewent.Clear();
			this.cdtrack = 0;
			this.looptrack = 0;
			this.scores = null;
		}

		public client_state_t()
		{
			this.stats = new int[QStats.MAX_CL_STATS];
			this.item_gettime = new float[32];
			this.cshifts = new cshift_t[4];
			for (int i = 0; i < 4; i++)
			{
				this.cshifts[i] = new cshift_t();
			}
			this.prev_cshifts = new cshift_t[4];
			for (int j = 0; j < 4; j++)
			{
				this.prev_cshifts[j] = new cshift_t();
			}
			this.mviewangles = new Vector3[2];
			this.mvelocity = new Vector3[2];
			this.mtime = new double[2];
			this.model_precache = new model_t[256];
			this.sound_precache = new sfx_t[256];
			this.viewent = new entity_t();
		}

		public int movemessages;

		public usercmd_t cmd;

		public int[] stats;

		public int items;

		public float[] item_gettime;

		public float faceanimtime;

		public cshift_t[] cshifts;

		public cshift_t[] prev_cshifts;

		public Vector3[] mviewangles;

		public Vector3 viewangles;

		public Vector3[] mvelocity;

		public Vector3 velocity;

		public Vector3 punchangle;

		public float idealpitch;

		public float pitchvel;

		public bool nodrift;

		public float driftmove;

		public double laststop;

		public float viewheight;

		public float crouch;

		public bool paused;

		public bool onground;

		public bool inwater;

		public int intermission;

		public int completed_time;

		public double[] mtime;

		public double time;

		public double oldtime;

		public float last_received_message;

		public model_t[] model_precache;

		public sfx_t[] sound_precache;

		public string levelname;

		public int viewentity;

		public int maxclients;

		public int gametype;

		public model_t worldmodel;

		public efrag_t free_efrags;

		public int num_entities;

		public int num_statics;

		public entity_t viewent;

		public int cdtrack;

		public int looptrack;

		public scoreboard_t[] scores;
	}
}
