public void AttachToBack(IMovable obj) { if (AttachedPrev == null) { AttachedPrev = obj; obj.AttachToFront(this); } else { AttachedPrev.AttachToBack(obj); } }
public IMovable RemoveFromBack(IMovable obj) { if (AttachedPrev == null) { return(null); } if (AttachedPrev.Equals(obj)) { IMovable prev = AttachedPrev; AttachedPrev = null; return(prev); } else { return(AttachedPrev.RemoveFromBack(obj)); } }