/// <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); }
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; }
/// <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); } } }
/// <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); }