예제 #1
0
        public SortedPosList Clone()
        {
            SortedPosList s = new SortedPosList();

            foreach (var item in posList)
            {
                s.Add(item.Clone());
            }
            return(s);
        }
예제 #2
0
        public SortedPosList circleContent(Position centerPos, double radius)
        {
            SortedPosList s = this.Clone();

            for (int i = 0; i < s.Count; i++)
            {
                if (!(s[i] % centerPos < radius))
                {
                    s.Remove(s[i]);
                }
            }
            return(s);
        }
예제 #3
0
        static void Main(string[] args)
        {
            SortedPosList posList = new SortedPosList();

            posList.Add(new Position(6, 1));
            posList.Add(new Position(9, 2));
            posList.Add(new Position(5, 4));
            posList.Add(new Position(-4, 9));

            SortedPosList posList2 = new SortedPosList();

            posList.Add(new Position(6, 1));
            posList.Add(new Position(9, 2));
            posList.Add(new Position(5, 4));
            posList.Add(new Position(-4, 9));

            SortedPosList combinedList = posList + posList2;

            Console.WriteLine(combinedList.ToString());
        }