private short GetTmpRP(GxRoadPointAstar.TMPRPINDEX tempRPIndex, short p_MapIdx, short x, short y) { List <short> list = new List <short>(); this.m_pkRPSys.GetValidRangeRPIndexes(p_MapIdx, x, y, ref list); GxRP gxRP = (tempRPIndex != GxRoadPointAstar.TMPRPINDEX.RAS_TMPSP_INDEX) ? this.m_dTmpRP : this.m_sTmpRP; this.m_sRPIdx = ((tempRPIndex != GxRoadPointAstar.TMPRPINDEX.RAS_TMPSP_INDEX) ? this.m_sRPIdx : -100); this.m_dRPIdx = ((tempRPIndex != GxRoadPointAstar.TMPRPINDEX.RAS_TMPDP_INDEX) ? this.m_dRPIdx : -200); gxRP.ClearData(); gxRP.SetData((short)tempRPIndex, p_MapIdx, x, y); if (list.Count != 0) { foreach (short current in list) { if (!gxRP.AddLinkedRP(current)) { break; } } } else { short nerestRP = this.m_pkRPSys.GetNerestRP(p_MapIdx, x, y, false, false); gxRP.AddLinkedRP(nerestRP); } return((short)tempRPIndex); }
public bool LinkRP(short MapIndex, short sRPIdx1, short sRPIdx2) { GxRP rP = this.GetRP(MapIndex, (int)sRPIdx1); if (rP == null || rP.GetLinkedCount() <= 4) { return(false); } GxRP rP2 = this.GetRP(MapIndex, (int)sRPIdx2); if (rP2 == null || rP2.GetLinkedCount() <= 4) { return(false); } rP.AddLinkedRP(sRPIdx2); rP2.AddLinkedRP(sRPIdx1); return(true); }