Example #1
0
 /// <summary>
 /// Moves a <see cref="Thing"/> into a given <see cref="Container"/>,
 /// regardless of where the <see cref="Thing"/> is before the move.
 /// Can be used to bring a <see cref="Thing"/> into play.
 /// Therefore, the <see cref="Thing"/>'s location may be null.
 /// This function checks for that possibility and handles it.
 /// </summary>
 /// <param name="item">the <see cref="Thing"/> to move</param>
 /// <param name="place">the <see cref="Container"/> to put it in</param>
 public static void Move(Thing item, Container place)
 {
     if (item.GetLocation() != null) {
         item.GetLocation().RemoveThing(item); }
     item.SetLocation(place);
     place.AddThing(item);
 }