private void DrawTurretESP(Turret turret)
        {
            if (!turret.IsValid)
                return;

            if (!Settings.Default.Turrets)
                return;

            // Don't draw the ESP if the other vector is very close
            if (Vector.Distance(turret.Origin, Game.ViewOrigin) < 80.0f)
                return;

            PointF botPoint, topPoint;
            if (MathHelper.WorldToScreen(turret.Origin, out botPoint)) {
                MathHelper.WorldToScreen(turret.Origin + new Vector(0f, 0f, 55f), out topPoint);
            } else {
                return;
            }

            var drawPoint = new PointF();
            drawPoint.Y = botPoint.Y - topPoint.Y;
            drawPoint.X = drawPoint.Y / 2.75f;

            var boundingBox = new RectangleF();
            boundingBox.X = botPoint.X - (drawPoint.X / 2.0f);
            boundingBox.Y = botPoint.Y;
            boundingBox.Width = drawPoint.X;
            boundingBox.Height = -drawPoint.Y;

            var namePoint = new PointF();
            namePoint.X = boundingBox.X + boundingBox.Width + 5.0f;
            namePoint.Y = botPoint.Y - drawPoint.Y - 2.8f;

            DrawRect(boundingBox, 2.0f, Color.Purple);
            DrawSmallText(Turret.NAME, namePoint, Color.White);
        }
        public static void ReadGame()
        {
            if (hProcess == IntPtr.Zero)
                throw new SystemException("Failed to read structs from the game");

            ViewOrigin = ProcessMemory.Read<Vector>(hProcess, Address.ViewOrigin);
            RefDef = ProcessMemory.Read<RefDef>(hProcess, Address.RefDef);
            Entities = ProcessMemory.ReadArray<Entity>(hProcess, Address.Entity, Entity.LENGTH, Entity.SIZE);
            Clients = ProcessMemory.ReadArray<ClientInfo>(hProcess, Address.ClientInfo, ClientInfo.LENGTH, ClientInfo.SIZE);
            Camera = ProcessMemory.Read<Camera>(hProcess, Address.Camera);
            CG = ProcessMemory.Read<ClientGame>(hProcess, Address.ClientGame);
            CGS = ProcessMemory.Read<ClientGameState>(hProcess, Address.ClientGameState);

            Players.Clear();
            Turrets.Clear();
            Helis.Clear();
            Planes.Clear();
            Explosives.Clear();

            for (int i = 0; i < Entities.Length; i++) {
                bool isEntityValid = (Entities[i].isValid & 1) == 1;

                switch (Entities[i].type) {
                    case EntityType.Player:
                        var player = new Player();
                        player.IsValid = isEntityValid;
                        player.ClientNum = Clients[i].clientNum;
                        player.Origin = Entities[i].origin;
                        player.Angles = Clients[i].angles;
                        player.Flag = Entities[i].flags;
                        player.IsAlive = isEntityValid;
                        player.Name = Clients[i].name;
                        player.Team = Clients[i].team1 == Clients[CG.clientNum].team1
                            && Clients[CG.clientNum].team2 != 0
                            ? PlayerTeam.Friendly : PlayerTeam.Hostile;
                        player.Rank = Clients[i].rank + 1;
                        player.Score = Clients[i].score;
                        if (player.ClientNum == CG.clientNum)
                            LocalPlayer = player;
                        Players.Add(player);
                        break;

                    case EntityType.Turret:
                        var turret = new Turret();
                        turret.IsValid = isEntityValid;
                        turret.ClientNum = Entities[i].clientNum;
                        turret.Origin = Entities[i].origin;
                        Turrets.Add(turret);
                        break;

                    case EntityType.Helicopter:
                        var heli = new Helicopter();
                        heli.IsValid = isEntityValid;
                        heli.ClientNum = Entities[i].clientNum;
                        heli.Origin = Entities[i].origin;
                        Helis.Add(heli);
                        break;

                    case EntityType.Plane:
                        var plane = new Plane();
                        plane.IsValid = isEntityValid;
                        plane.ClientNum = Entities[i].clientNum;
                        plane.Origin = Entities[i].origin;
                        Planes.Add(plane);
                        break;

                    case EntityType.Explosive:
                        var explosive = new Explosive();
                        explosive.IsValid = isEntityValid;
                        explosive.ClientNum = Entities[i].clientNum;
                        explosive.Origin = Entities[i].origin;
                        Explosives.Add(explosive);
                        break;
                }
            }
        }