Beispiel #1
0
        /// <summary>
        /// Initializes the IconCollection
        /// Creates Orbitrings, TextIcons and Entityicons and adds them to Collection
        /// </summary>
        /// <param name="entities"></param>
        /// <param name="camera"></param>
        public void Init(IEnumerable <Entity> entities, Camera2dv2 camera)
        {
            IconDict.Clear();
            OrbitList.Clear();
            TextIconList.Clear();
            EntityList.Clear();
            scale = new ScaleIcon(camera);

            foreach (var item in entities)
            {
                if (item.HasDataBlob <OrbitDB>() && item.GetDataBlob <OrbitDB>().Parent != null)
                {
                    OrbitRing ring = new OrbitRing(item, camera);
                    OrbitList.Add(ring);
                }
                if (item.HasDataBlob <NameDB>())
                {
                    TextIconList.Add(new TextIcon(item, camera));
                }


                EntityIcon entIcon = new EntityIcon(item, camera);
                EntityList.Add(entIcon);


                IconDict.Add(item.Guid, entIcon);
            }
        }
Beispiel #2
0
        /// <summary>
        /// Initializes the IconCollection
        /// Creates Orbitrings, TextIcons and Entityicons and adds them to Collection
        /// </summary>
        /// <param name="entities"></param>
        /// <param name="camera"></param>
        public void Init(IEnumerable <Entity> entities, Camera2dv2 camera)
        {
            IconDict.Clear();
            OrbitList.Clear();
            TextIconList.Clear();
            EntityList.Clear();
            _camera = camera;
            Scale   = new ScaleIcon(_camera);

            foreach (var item in entities)
            {
                AddNewIcon(item);
            }
        }