Example #1
0
        public List <MapFootholdSide> GetConnectionAt(int x, int y)
        {
            List <MapFootholdSide> l = new List <MapFootholdSide>();

            foreach (MapFoothold f in footholds.Values)
            {
                MapFootholdSide side = f.GetSideAt(x, y);
                if (side != null)
                {
                    l.Add(side);

                    int other = side.GetConnected();
                    if (footholds.Contains(other))
                    {
                        l.Add(((MapFoothold)footholds[other]).GetSideAt(x, y));
                    }
                    return(l);
                }
            }
            return(l);
        }
Example #2
0
 private void ShortFoothold(MapFootholdSide fh)
 {
     int x1 = fh.Object.GetInt("x1");
     int y1 = fh.Object.GetInt("y1");
     int x2 = fh.Object.GetInt("x2");
     int y2 = fh.Object.GetInt("y2");
     double d = MapFoothold.Distance(x1, y1, x2, y2);
     if (fh.ID == 1)
     {
         double xp = (x2 * 10 + x1 * (d - 10)) / d;
         double yp = (y2 * 10 + y1 * (d - 10)) / d;
         fh.Object.SetInt("x1", (int)xp);
         fh.Object.SetInt("y1", (int)yp);
     }
     else
     {
         double xp = (x1 * 10 + x2 * (d - 10)) / d;
         double yp = (y1 * 10 + y2 * (d - 10)) / d;
         fh.Object.SetInt("x2", (int)xp);
         fh.Object.SetInt("y2", (int)yp);
     }
 }