public void Two_entities_with_the_same_Id_should_equal_each_other()
        {
            var first = new Entity{Id = 99};
            var second = new Entity { Id = 99 };

            first.Equals(second).ShouldBeTrue();
            second.Equals(first).ShouldBeTrue();

            Equals(first, second).ShouldBeTrue();
            Equals(second, first).ShouldBeTrue();

            first.GetHashCode().ShouldEqual(second.GetHashCode());

            (first == second).ShouldBeTrue();
            (second == first).ShouldBeTrue();

            (first != second).ShouldBeFalse();
            (second != first).ShouldBeFalse();
        }
        public void Two_entities_with_different_Ids_should_not_equal_each_other()
        {
            var first = new Entity { Id = 66 };
            var second = new Entity { Id = 77 };

            first.Equals(second).ShouldBeFalse();
            second.Equals(first).ShouldBeFalse();

            Equals(first, second).ShouldBeFalse();
            Equals(second, first).ShouldBeFalse();

            first.GetHashCode().ShouldNotEqual(second.GetHashCode());

            (first == second).ShouldBeFalse();
            (second == first).ShouldBeFalse();

            (first != second).ShouldBeTrue();
            (second != first).ShouldBeTrue();
        }
        /// <summary>
        ///     Draw a specified entity
        /// </summary>
        /// <param name="e">The entity to draw</param>
        private void DrawEntity(Entity e)
        {
            if (!e.IsOnScreen || e.IsOccluded) return;

            var textScale = .25f;

            //Set text color
            var c = Color.FromArgb(150, Color.White);
            if (_selectedEntity != null && e.Equals(_selectedEntity)) c = Color.Red;
            else {
                switch (GTAFuncs.GetEntityType(e)) {
                    case GTAFuncs.EntityType.Ped:
                        c = new Ped(e.Handle).IsPlayer
                            ? Color.FromArgb(150, Color.CornflowerBlue)
                            : Color.FromArgb(150, Color.Yellow);
                        break;
                    case GTAFuncs.EntityType.Vehicle:
                        c = Color.FromArgb(150, Color.DeepPink);
                        break;
                    case GTAFuncs.EntityType.Prop:
                        c = Color.FromArgb(150, Color.Green);
                        break;
                }
            }

            //Create entity info lines
            var lines = new List<string>();

            switch(GTAFuncs.GetEntityType(e)) {
                case GTAFuncs.EntityType.Ped:
                    Ped ped = new Ped(e.Handle);
                    if (ped.IsPlayer) {
                        Player pl = GTAFuncs.GetPedPlayer(ped);
                        lines.Add(pl.Name);
                        lines.Add("Player #" + pl.Handle);
                        if (GTAFuncs.GetPlayerInvincible(pl)) lines.Add("INVINCIBLE");
                    }
                    lines.Add("Ped #" + ped.Handle);
                    e = ped;
                    break;
                case GTAFuncs.EntityType.Vehicle:
                    Vehicle v = new Vehicle(e.Handle);
                    lines.Add("Vehicle #" + v.Handle);
                    lines.Add(v.FriendlyName);
                    lines.Add(v.DisplayName);
                    e = v;
                    break;
                case GTAFuncs.EntityType.Prop:
                    Prop prop = new Prop(e.Handle);
                    lines.Add("Prop #" + prop.Handle);
                    lines.Add("Model: " + prop.Model.Hash);
                    e = prop;
                    break;
                default:
                    lines.Add("Entity #" + e.Handle);
                    break;
            }

            Entities.Add(e.Handle, e);

            //Draw entity info
            var screenPos = GTAFuncs.WorldToScreen(e.Position);
            var contain =
                new Rectangle(
                    new Point((int) screenPos.X,
                        (int)screenPos.Y + (GTAFuncs.GetEntityType(e) == GTAFuncs.EntityType.Ped && new Ped(e.Handle).IsInVehicle() ? lines.Count * -10 : 0)),
                    new Size(50, (lines.Count*11) - 1));

            for (var i = 0; i < lines.Count; i++) {
                GTAFuncs.SetTextDropShadow(2, Color.FromArgb(255, 0, 0, 0));
                new UIText(lines[i], new Point(0, (i*10)), textScale, Color.FromArgb(255, c), 0, true).Draw(
                    new Size(contain.Location));
                GTAFuncs.SetTextDropShadow(0, Color.Transparent);
            }

            EntityClickBoxes.Add(e, contain);
            DrawEntBox(e, c);
        }