protected override Bondegard MapTo(Bondegard bondegard)
 {
     bondegard.Bonde = Bonde.ToEntity();
     bondegard.Navn  = Navn;
     Staller.Each(s => bondegard.AddStall(s.ToEntity()));
     Traktorer.Each(t => bondegard.AddTraktor(t.ToEntity()));
     Fjoser.Each(f => bondegard.AddFjos(f.ToEntity()));
     return(bondegard);
 }
Example #2
0
 public void copyBoard(Board originalBoard)
 {
     for (int y = 0; y < 8; y++)
     {
         for (int x = 0; x < 8; x++)
         {
             Pjäs pjäs = originalBoard.Pjäser[y, x];
             if (pjäs == null)
             {
                 continue;
             }
             else if (pjäs is Bonde)
             {
                 Pjäser[y, x] = new Bonde(pjäs.färg);
             }
             else if (pjäs is Torn)
             {
                 Pjäser[y, x] = new Torn(pjäs.färg);
             }
             else if (pjäs is Häst)
             {
                 Pjäser[y, x] = new Häst(pjäs.färg);
             }
             else if (pjäs is Löpare)
             {
                 Pjäser[y, x] = new Löpare(pjäs.färg);
             }
             else if (pjäs is Kung)
             {
                 Pjäser[y, x] = new Kung(pjäs.färg);
             }
             else if (pjäs is Dam)
             {
                 Pjäser[y, x] = new Dam(pjäs.färg);
             }
         }
     }
 }