コード例 #1
0
        public void Save()
        {
            var pointList        = new List <float[]>();
            var triList          = new List <int[]>();
            var routeList        = new List <float[]>();
            int vendorPointIndex = -1;

            var pointIndices = new Dictionary <Point, int>();

            foreach (Point p in Points)
            {
                pointList.Add(new float[2] {
                    p.X, p.Y
                });
                pointIndices[p] = pointList.Count - 1;
            }

            foreach (Tri t in Tris)
            {
                triList.Add(t.Points.Select(p => pointIndices[p]).ToArray());
            }

            foreach (Point p in Route)
            {
                routeList.Add(new float[2] {
                    p.X, p.Y
                });

                if (p == VendorPoint)
                {
                    vendorPointIndex = routeList.Count - 1;
                }
            }

            var serializablePlan = new Plan.Serializable {
                Points = pointList, Tris = triList, Route = routeList, VendorPoint = vendorPointIndex
            };

            planProvider.Save(serializablePlan, MapId);
        }
コード例 #2
0
ファイル: PlanProvider.cs プロジェクト: jnoyola/GW2-Live
 public void Save(Plan.Serializable plan, int mapId)
 {
     FileManager.SaveToFile(plan, Folder, String.Format(FileFormat, mapId));
 }