FieldConnectPoint ToFieldConnectPoint(RiverPoint riverPoint) { var point = new FieldConnectPoint(); point.Initialize(riverPoint.Position, PointType.kRiver); return(point); }
/** * フィールドの座標リストを接続クラスに変えてリストにする */ void SetFieldPoint() { int i0, i1; FieldConnectPoint createPoint; List <FieldConnectPoint> addList; bool flg; riverConnectPointList.Clear(); roadConnectPointList.Clear(); sugorokuConnectPointList.Clear(); for (i0 = 0; i0 < fieldPointList.Count; ++i0) { for (i1 = 0; i1 < 3; ++i1) { flg = false; switch (i1) { case 0: addList = riverConnectPointList; if (fieldPointList[i0].Type == PointType.kRiver) { flg = true; } break; case 1: addList = roadConnectPointList; if (fieldPointList[i0].Type == PointType.kRoadAlongRiver || fieldPointList[i0].Type == PointType.kGridRoad || fieldPointList[i0].Type == PointType.kDistrictRoad || fieldPointList[i0].Type == PointType.kIntersectionOfGridRoadAndRoadAlongRiver || fieldPointList[i0].Type == PointType.kIntersectionOfGridRoadAndDistrictRoad || fieldPointList[i0].Type == PointType.kIntersectionOfRoadAlongRiverAndDistrictRoad) { flg = true; } break; case 2: addList = sugorokuConnectPointList; if (fieldPointList[i0].Type == PointType.kGridRoad || fieldPointList[i0].Type == PointType.kIntersectionOfGridRoadAndRoadAlongRiver || fieldPointList[i0].Type == PointType.kIntersectionOfGridRoadAndDistrictRoad) { flg = true; } break; default: addList = riverConnectPointList; flg = false; break; } if (flg != false) { createPoint = new FieldConnectPoint(); createPoint.Initialize(fieldPointList[i0].Position, fieldPointList[i0].Type); addList.Add(createPoint); } } } }