Ejemplo n.º 1
0
        public void AddTarget(LazyBot.Area.Searching.SearchingArea area, LazyBot.Area.Detection.DetectionArea detectionArea)
        {
            if (area.TargetType == null)
            {
                return;
            }

            AddTargetType(area.TargetType);

            if (area.TargetType.DataOnDetection) // Filling data instantly
            {
                _targets[area.TargetType].AddTarget(
                    area.Id,
                    LazyBot.Manager.EntityManager.Instance.GetProperties(detectionArea.OwnerId, area.TargetType.Mask)
                    );
            }
            else // Data will be filled on state execution
            {
                _targets[area.TargetType].AddTarget(
                    area.Id,
                    () => {
                    LazyBot.Manager.EntityManager.Instance.GetProperties(detectionArea.OwnerId, area.TargetType.Mask);
                }
                    );
            }
        }
Ejemplo n.º 2
0
        public void InitTargetContainer(LazyBot.Area.Searching.SearchingArea area)
        {
            if (area.TargetType == null)
            {
                return;
            }

            AddTargetType(area.TargetType);

            _targets[area.TargetType].AddArea(area.Id);
        }
Ejemplo n.º 3
0
        public void ClearTarget(LazyBot.Area.Searching.SearchingArea area)
        {
            if (area.TargetType == null)
            {
                return;
            }

            Target.Data.TargetInfo.TargetContainer targetContainer;

            if (_targets.Data.TryGetValue(area.TargetType, out targetContainer))
            {
                targetContainer.Erase(area.Id);
            }
        }