Example #1
0
        public static void uppdateraMöjligaDrag(Fält nyttDrag)
        {
            möjligaDrag.Remove(nyttDrag);

            for (int x = nyttDrag.X - 1; x <= nyttDrag.X + 1 && x < sida; x++)
            {
                for (int y = nyttDrag.Y - 1; y <= nyttDrag.Y + 1 && y < sida; y++)
                {
                    if (x >= 0 && y >= 0 && ställning[x, y] == 0 && !möjligaDrag.Contains(new Fält(x, y)))
                    {
                        möjligaDrag.Add(new Fält(x, y));
                    }
                }
            }
        }
Example #2
0
 protected XElement CreateValue(Fält fält)
 {
     return(new XElement(_ku + fält.Key.ToString(), new XAttribute("faltkod", ((int)fält.Key).ToString("000", CultureInfo.InvariantCulture)), fält.Value));
 }
Example #3
0
 public Fält(int x, int y)
 {
     this = new Fält();
             this.X = x;
             this.Y = y;
 }
Example #4
0
        public static void uppdateraMöjligaDrag(Fält nyttDrag)
        {
            möjligaDrag.Remove(nyttDrag);

                  for (int x = nyttDrag.X - 1; x <= nyttDrag.X + 1 && x < sida; x++) {
                        for (int y = nyttDrag.Y - 1; y <= nyttDrag.Y + 1 && y < sida; y++) {
                              if (x >= 0 && y >= 0 && ställning[x, y] == 0 && !möjligaDrag.Contains(new Fält(x, y))) {
                                    möjligaDrag.Add(new Fält(x, y));
                              }
                        }
                  }
        }
Example #5
0
 public Fält(int x, int y)
 {
     this   = new Fält();
     this.X = x;
     this.Y = y;
 }