Exemplo n.º 1
0
        /// <summary>
        /// 通过索引获取三角形
        /// </summary>
        /// <param name="index"></param>
        /// <returns></returns>
        public GolfMaptriangle GetMapTriangle(Index2 index)
        {
            GolfAISubMap sm = GetSubMap(index.MapID);

            if (sm != null)
            {
                return(sm.GetGolfMaptriangle((int)index.TriID));
            }
            return(null);
        }
Exemplo n.º 2
0
 public GolfCourseMap(MapData data)
 {
     if (data == null)
     {
         return;
     }
     foreach (SubMapData d in data.ListMap)
     {
         GolfAISubMap submap = new GolfAISubMap();
         submap.Create(d);
         this.AddSubMap(submap);
     }
     this.SetGolfHale(data.HolePos, data.HoleRadius);
     this.m_StartPos = data.StartPos;
 }
Exemplo n.º 3
0
 /// <summary>
 /// 添加高尔夫地图子元素。
 /// </summary>
 public void AddSubMap(GolfAISubMap subMap)
 {
     if (subMap == null)
     {
         return;
     }
     else
     {
         if (m_ListSubMap == null)
         {
             m_ListSubMap = new List <GolfAISubMap>();
         }
         if (m_ListSubMap.Contains(subMap) == false)
         {
             m_ListSubMap.Add(subMap);
         }
     }
 }
Exemplo n.º 4
0
        /// <summary>
        /// 获取投影到的子地图
        /// </summary>
        /// <param name="s"></param>
        /// <param name="e"></param>
        /// <returns></returns>
        private List <GolfAISubMap> GetProjectionMap(Vector2 p, GolfAISubMap Exitmap)
        {
            List <GolfAISubMap> l = new List <GolfAISubMap>();

            if (m_ListSubMap != null)
            {
                foreach (GolfAISubMap map in m_ListSubMap)
                {
                    if (map == Exitmap)
                    {
                        continue;
                    }
                    // 排除与整个地图不相交的情况。
                    if (map.CheckProjectionInArea(p) == true)
                    {
                        l.Add(map);
                    }
                }
            }
            return(l);
        }