예제 #1
0
        public void SetSerializedData(SugorokuSerializedData data)
        {
            int i0, i1;

            sugorokuPointDataList = data.GetPointDataList();

            sugorokuPointList.Clear();
            sugorokuDataList.Clear();

            for (i0 = 0; i0 < sugorokuPointDataList.Count; ++i0)
            {
                var point = new FieldConnectPoint();
                point.Initialize(sugorokuPointDataList[i0].GetPosition(), PointType.kGridRoad);
                point.Index = sugorokuPointDataList[i0].GetIndex();
                sugorokuDataList.Add(sugorokuPointDataList[i0].GetRoomType());
                sugorokuPointList.Add(point);
            }
            for (i0 = 0; i0 < sugorokuPointDataList.Count; ++i0)
            {
                var indexList = sugorokuPointDataList[i0].GetConnectionIndexList();
                for (i1 = 0; i1 < indexList.Count; ++i1)
                {
                    sugorokuPointList[i0].SetConnection(sugorokuPointList[indexList[i1]]);
                }
            }

            startIndex = data.GetStartIndex();
            goalIndex  = data.GetGoalIndex();

            if (pointList == null)
            {
                pointList = new List <FieldConnectPoint>();
            }
            pointList.Clear();
            pointList.AddRange(sugorokuPointList);
        }
예제 #2
0
        public void SetSerializedData(SugorokuSerializedData data)
        {
            pointDataList = data.GetPointDataList();

            sugorokuPoints.Clear();
            masuTypes.Clear();

            for (int i0 = 0; i0 < pointDataList.Count; ++i0)
            {
                var point = new FieldConnectPoint();
                SugorokuPointData pointData = pointDataList[i0];
                point.Initialize(pointData.GetPosition(), PointType.kGridRoad);
                point.Index = pointData.GetIndex();
                masuTypes.Add(pointData.GetRoomType());
                sugorokuPoints.Add(point);
            }

            for (int i0 = 0; i0 < pointDataList.Count; ++i0)
            {
                var indexList = pointDataList[i0].GetConnectionIndexList();
                for (int i1 = 0; i1 < indexList.Count; ++i1)
                {
                    sugorokuPoints[i0].SetConnection(sugorokuPoints[indexList[i1]]);
                }
            }

            startIndex = data.GetStartIndex();
            goalIndex  = data.GetGoalIndex();

            if (allPoints == null)
            {
                allPoints = new List <FieldConnectPoint>();
            }
            allPoints.Clear();
            allPoints.AddRange(sugorokuPoints);
        }