예제 #1
0
        /// <summary>
        ///     Wird von der Extension aufgerufen, wenn ein Element sich aus dem
        ///     sichtbaren Radius entfernt.
        /// </summary>
        /// <param name="item">Nicht mehr sehendes Element</param>
        internal void RemoveSightingItem(SightingProperty item)
        {
            if (sightingItems.Contains(item))
            {
                sightingItems.Remove(item);

                if (OnLostSightingItem != null)
                {
                    OnLostSightingItem(item);
                }
            }
        }
예제 #2
0
        /// <summary>
        ///     Wird von der Extension aufgerufen, wenn sich ein Element in den
        ///     sichtbaren Radius bewegt.
        /// </summary>
        /// <param name="item">Neu sehendes Element</param>
        internal void AddSightingItem(SightingProperty item)
        {
            if (!sightingItems.Contains(item))
            {
                sightingItems.Add(item);

                if (OnNewSightingItem != null)
                {
                    OnNewSightingItem(item);
                }
            }
        }
예제 #3
0
        /// <summary>
        /// Default Constructor for the Type Mapper.
        /// </summary>
        /// <param name="item">Related Engine Item</param>
        /// <param name="property">Related Engine Property</param>
        public SightingState(Item item, SightingProperty property) : base(item, property)
        {
            // Bind Direction to the Item Direction
            ViewDirection = (short)property.ViewDirection.Degree;
            property.OnViewDirectionChanged += (i, v) => { ViewDirection = (short)v.Degree; };

            // Bind Angle to the Item Angle
            ViewAngle = property.ViewAngle;
            property.OnViewAngleChanged += (i, v) => { ViewAngle = v; };

            // Bind View Range to the Item View Range
            ViewRange = property.ViewRange;
            property.OnViewRangeChanged += (i, v) => { ViewRange = v; };
        }