예제 #1
0
        /// <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);
        }
예제 #2
0
 /// <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);
     }
 }
예제 #3
0
        /// <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);
        }
예제 #4
0
 bool ContainCard(SortingBox box, Card card)
 {
     foreach (Card cd in box.CardList)
     {
         if (card.CardID == cd.CardID)
         {
             return(true);
         }
     }
     return(false);
 }
예제 #5
0
 /// <summary>
 /// Get all cards in a sorting box
 /// </summary>
 /// <param name="box"></param>
 /// <returns></returns>
 internal List <Card> GetCardsBySortingBox(SortingBox box)
 {
     return(box.CardList);
 }
예제 #6
0
 /// <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);
 }
예제 #7
0
 /// <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);
 }
예제 #8
0
 /// <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);
 }
예제 #9
0
 /// <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);
 }