Exemple #1
0
 /// <summary>
 /// Creates a new object that is a copy of the current instance.
 /// </summary>
 /// <returns>
 /// A new object that is a copy of this instance.
 /// </returns>
 public object Clone()
 {
     // ReSharper disable once UseObjectOrCollectionInitializer
     var ml = new MoveList();
     ml.StartPlayer = StartPlayer;
     ml.MoveCount = MoveCount;
     ml.Moves = Moves.Select(x => x.Clone() as MoveItem).ToList();
     return ml;
 }
Exemple #2
0
 public void AlignTo(MoveList list)
 {
     if (list.MoveCount == 0)
         return;
     foreach (var t in GetTransforms())
     {
         var match = true;
         for (var i = 0; i < (list.MoveCount > MoveCount ? list.MoveCount : MoveCount); i++)
         {
             if (list.Moves[i] != Moves[i])
             {
                 match = false;
                 break;
             }
         }
         if (match)
         {
             Moves = t.Moves;
             return;
         }
     }
 }