Esempio n. 1
0
 public EyeableBorderObjInfo(IEyeableInfo eyeableInfo, ObjVisiBorder border)
 {
     this.eyeableInfo = eyeableInfo;
     this.border      = border;
 }
Esempio n. 2
0
 public EyeableBorderObjInfo ( IEyeableInfo eyeableInfo, ObjVisiBorder border )
 {
     this.eyeableInfo = eyeableInfo;
     this.border = border;
 }
Esempio n. 3
0
        public void CalSheltersVisiBorder()
        {
            Dictionary<IShelterObj, List<VisiBordPoint>> temp = new Dictionary<IShelterObj, List<VisiBordPoint>>();

            int index = 0;
            foreach (IShelterObj obj in objMap)
            {
                if (obj != null)
                {
                    if (!temp.ContainsKey( obj ))
                    {
                        temp.Add( obj, new List<VisiBordPoint>() );
                    }
                    temp[obj].Add( objBordIndexMap[index] );
                }
                index++;
            }

            curObjVisiBorders = new ObjVisiBorder[temp.Count];

            curShelters = new IShelterObj[temp.Count];

            int i = 0;
            foreach (KeyValuePair<IShelterObj, List<VisiBordPoint>> pair in temp)
            {
                pair.Value.Sort(
                    delegate( VisiBordPoint p1, VisiBordPoint p2 )
                    {
                        if (p1.index < p2.index)
                            return -1;
                        else if (p1.index == p2.index)
                            return 0;
                        else
                            return 1;
                    } );

                CircleList<VisiBordPoint> points = new CircleList<VisiBordPoint>();

                foreach (VisiBordPoint p in pair.Value)
                {
                    if (points.Last == null || points.Last.value.index != p.index)
                        points.AddLast( p );
                }

                curObjVisiBorders[i] = new ObjVisiBorder( (IHasBorderObj)pair.Key, points );
                curShelters[i] = pair.Key;

                i++;
            }
        }