public void SelectBuildpoint(BuildPoint buildPoint)
 {
     foreach (BuildPoint b in buildPoints)
     {
         b.ToggleLight(false);
     }
     selectedBuildpoint = buildPoint;
     selectedBuildpoint.ToggleLight(true);
 }
예제 #2
0
파일: Server.cs 프로젝트: Iwancof/CinCity
        string[] fondtype = { "CM", "RO", "BU", "CL" }; //構造物一覧的な

        public void CheckMessage(string str)
        {
            ClearPoint = new Point(-1, -1);
            for (int i = 0; i < fondtype.Length; i++)
            {
                string f          = fondtype[i];
                int    foundIndex = str.IndexOf(f);
                while (0 <= foundIndex)
                {
                    int   id            = int.Parse(str.Substring(foundIndex + 4, 2));
                    Point TextRoadPoint = new Point(int.Parse(str.Substring(foundIndex + 7, 3)), int.Parse(str.Substring(foundIndex + 11, 3)));
                    if (f == "CM")
                    {
                        CriterionMarkers[id] = TextRoadPoint;
                    }
                    if (f == "RO")
                    {
                        if (IsMarkered)
                        {
                            double X_Co = (double)TextRoadPoint.X - (double)CriterionMarkers[0].X; //カメラ座標どうして差分を取って係数をかける
                            X_Co /= X_Converting_coefficient;
                            double Y_Co = (double)TextRoadPoint.Y - (double)CriterionMarkers[0].Y; //上記に同じ
                            Y_Co                    /= Y_Converting_coefficient;
                            RoadMarkers[id]          = new Point((int)X_Co + Dif, (int)Y_Co + Dif);
                            RoadMarkersAvailable[id] = true;
                            //drawstirng = "p:" + p.ToString() + " D:" + (p.X - TestRoad.X).ToString() + "," + (p.Y - TestRoad.Y).ToString(); //テストコード
                        }
                    }
                    if (f == "BU")
                    {
                        if (BuildPoint.ContainsKey(id))
                        {
                            BuildPoint[id] = TextRoadPoint;
                        }
                        else
                        {
                            BuildPoint.Add(id, TextRoadPoint);
                        }
                    }
                    if (f == "CL")
                    {
                        ClearPoint = TextRoadPoint;
                    }
                    int nextIndex = foundIndex + fondtype.Length;
                    if (nextIndex < str.Length)
                    {
                        foundIndex = str.IndexOf(f, nextIndex);
                    }
                    else
                    {
                        break;
                    }
                }
            }
        }
 public void SetBuildpoints(BuildPoint next, BuildPoint last)
 {
     nextBuildpoint = next;
     lastBuildpoint = last;
 }
 public void AddBuildpoint(BuildPoint point)
 {
     buildPoints.Add(point);
 }