Exemplo n.º 1
0
 public Element(ElementDetails details, Direction direction)
 {
     Id      = IdCounter;
     Details = details;
     IdCounter++;
     Look = direction;
 }
Exemplo n.º 2
0
 public Element(ElementDetails details)
 {
     Id      = IdCounter;
     Details = details;
     IdCounter++;
     Look = details.StartFacing;
 }
Exemplo n.º 3
0
 public Board(byte width, byte height, string data)
 {
     RowCount = height;
     ColCount = width;
     Data     = new Element[RowCount * ColCount];
     char[] carray = data.ToCharArray();
     for (int i = 0; i < RowCount; i++)
     {
         for (int j = 0; j < ColCount; j++)
         {
             ElementDetails details = Element.CharToElementDetails(carray[(i * ColCount) + j]);
             Direction      dir     = Element.CharToFacing(carray[(i * ColCount) + j]);
             Element        e       = new Element(details, dir);
             if (e == null)
             {
                 continue;
             }
             Data[(i * ColCount) + j]      = new Element(e.Details);
             Data[(i * ColCount) + j].Look = e.Look;
         }
     }
 }