public EyeableBorderObjInfo ( IEyeableInfo eyeableInfo, ObjVisiBorder border )
 {
     this.eyeableInfo = eyeableInfo;
     this.border = border;
 }
Exemple #2
0
 public EyeableBorderObjInfo(IEyeableInfo eyeableInfo, ObjVisiBorder border)
 {
     this.eyeableInfo = eyeableInfo;
     this.border      = border;
 }
Exemple #3
0
        public void CalSheltersVisiBorder()
        {
            Dictionary<IShelterObj, List<BordPoint>> temp = new Dictionary<IShelterObj, List<BordPoint>>();

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

            curObjVisiBorders = new ObjVisiBorder[temp.Count];

            curShelters = new IShelterObj[temp.Count];

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

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

                foreach (BordPoint 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++;
            }
        }