public BlipData(Vector3 position, BlipSprite sprite, BlipCategory category, BlipColor color = BlipColor.White, bool isShortRange = true) { this.isEntityBlip = false; this.Position = position; this.Sprite = sprite; this.Color = color; this.IsShortRange = isShortRange; this.Category = category; Create(); }
public BlipData(Entity entity, BlipSprite sprite, BlipCategory category, BlipColor color = BlipColor.White, bool isShortRange = true) { this.isEntityBlip = true; this.Entity = entity; this.Sprite = sprite; this.Color = color; this.IsShortRange = isShortRange; this.Category = category; Create(); }
/// <summary> /// /// </summary> /// <param name="bitFilter">Bitwise combination of BlipCategory flags to show</param> internal static void Filter(BlipCategory bitFilter) { Dictionary <int, BlipData> New = All .Where(b => ((b.Value.Category & bitFilter) != 0)) .ToDictionary(b => b.Key, b => b.Value); // Delete blips that were filtered out Current .Where(b => New.Where(i => i.Value.Blip.Handle == b.Value.Blip.Handle).Count() == 0) .ToDictionary(i => i.Key, i => i.Value) .ToList() .ForEach(b => { b.Value.Blip.Delete(); }); // Add blips that are now added New .Where(b => Current.Where(i => i.Value.Blip.Handle == b.Value.Blip.Handle).Count() == 0) .ToDictionary(i => i.Key, i => i.Value) .ToList() .ForEach(b => { b.Value.Create(); }); }