/// <summary> /// Based on the user, create a sorting box. /// </summary> /// <param name="name"></param> /// <param name="user"></param> public SortingBox CreateSortingBox(User user, string name) { SortingBox box = list.AddBox(user, name, this); controllers.SortingBoxLayerController.LoadBoxes(new SortingBox[] { box }); return(box); }
/// <summary> /// Delete a sorting box /// </summary> /// <param name="box"></param> internal void RemoveSortingBox(SortingBox box) { if (list.ContainsKey(box.SortingBoxID)) { box.Clear(); list.Remove(box.SortingBoxID); } }
/// <summary> /// Add a sorting box to the list. Return the added box /// </summary> /// <param name="name"></param> internal SortingBox AddBox(User user, string name, SortingBoxController controller) { string sortingBoxID = Guid.NewGuid().ToString(); SortingBox box = new SortingBox(controller); box.Init(sortingBoxID, name, user); list.Add(sortingBoxID, box); return(box); }
bool ContainCard(SortingBox box, Card card) { foreach (Card cd in box.CardList) { if (card.CardID == cd.CardID) { return(true); } } return(false); }
/// <summary> /// Get all cards in a sorting box /// </summary> /// <param name="box"></param> /// <returns></returns> internal List <Card> GetCardsBySortingBox(SortingBox box) { return(box.CardList); }
/// <summary> /// Add a card to the sortingbox /// </summary> /// <param name="card"></param> /// <param name="box"></param> public void AddCardToSortingBox(Card card, SortingBox box) { box.AddCard(card); }
/// <summary> /// Update the ZIndex of the card. Move the card to the top. /// </summary> /// <param name="card"></param> internal void MoveSortingBoxToTop(SortingBox box) { controllers.SortingBoxLayerController.MoveSortingBoxToTop(box); }
/// <summary> /// Update the touch point /// </summary> /// <param name="localPoint"></param> /// <param name="globalPoint"></param> /// <param name="box"></param> /// <param name="type"></param> internal void PointerDown(PointerPoint localPoint, PointerPoint globalPoint, SortingBox box, Type type) { controllers.TouchController.TouchDown(localPoint, globalPoint, box, type); }
/// <summary> /// Delete a sorting box. Remove it both from the sorting box list and the sorting box layer. /// </summary> /// <param name="box"></param> internal void DestroyBox(SortingBox box) { list.RemoveSortingBox(box); controllers.SortingBoxLayerController.RemoveSortingBox(box); }