protected override void Translate(ExpandoObject objectToTranslate)
        {
            var objectAsDict = (IDictionary <string, object>)objectToTranslate;

            List <Segment> segmentList = GetSegmentList(objectAsDict);

            if (segmentList == null)
            {
                return;
            }

            string objectName = GetObjectName(objectAsDict);

            if (string.IsNullOrEmpty(objectName))
            {
                return;
            }
            ObjectTypeEnum objectType = GetObjectType(objectAsDict);
            string         iIP        = GetIIP(objectAsDict);
            string         other;

            if (!isNet)
            {
                List <string> translatedObjects = new List <string>();
                foreach (var segment in segmentList)
                {
                    var pointsList = AdditionalPointsCreation.CreatePointsInLine(segment.p1, segment.p2, propSize);
                    other = Calculations.Azimuth(segment.p1, segment.p2).ToString();

                    foreach (var point in pointsList)
                    {
                        translatedObjects.Add($"{objectType};{objectName};{iIP};{other};{point.X} {point.Y};");
                    }
                }

                foreach (var obj in translatedObjects)
                {
                    if (!string.IsNullOrEmpty(obj))
                    {
                        Console.WriteLine(obj);
                    }
                }
            }
            else
            {
                other = GetOther(objectAsDict);
                TranslatorUtils.WriteAttrToConsole(segmentList, objectType, objectName, iIP, other);
            }
        }
Exemple #2
0
        protected override void Translate(ExpandoObject objectToTranslate)
        {
            var objectAsDict = (IDictionary <string, object>)objectToTranslate;

            List <Segment> segmentList = GetSegmentList(objectAsDict);

            if (segmentList != null)
            {
                ObjectTypeEnum objectType = GetObjectType(objectAsDict);
                string         objectName = GetObjectName(objectAsDict);
                if (string.IsNullOrEmpty(objectName))
                {
                    return;
                }
                string iIP   = GetIIP(objectAsDict);
                string other = GetOther(objectAsDict);
                TranslatorUtils.WriteAttrToConsole(segmentList, objectType, objectName, iIP, other);
            }
        }
Exemple #3
0
        protected override void Translate(ExpandoObject objectToTranslate)
        {
            var objectAsDict = (IDictionary <string, object>)objectToTranslate;

            string gamePosition = GetPointPosition(objectAsDict);

            if (string.IsNullOrEmpty(gamePosition))
            {
                return;
            }
            string objectName = GetObjectName(objectAsDict);

            if (string.IsNullOrEmpty(objectName))
            {
                return;
            }
            ObjectTypeEnum objectType = GetObjectType(objectAsDict);
            string         iIP        = GetIIP(objectAsDict);
            string         other      = GetOther(objectAsDict, currentPoint);

            TranslatorUtils.WriteAttrToConsole(objectType, objectName, iIP, other, gamePosition);
        }