Esempio n. 1
0
 public static bool DoesInputHaveDupNumbers(int dupEntryValue, CurrentDress changeCloths)
 {
     if (dupEntryValue > 0)
     {
         changeCloths.Dress = changeCloths.Dress + ", fail";
         return(true);
     }
     return(false);
 }
Esempio n. 2
0
 public static bool IsInputStrTooShort(string[] userInputSplit, CurrentDress changeCloths)
 {
     if (userInputSplit.Length <= 1)
     {
         changeCloths.Dress = "fail";
         return(true);
     }
     return(false);
 }
Esempio n. 3
0
 public static bool DoesInputStartsWithNum8(string[] userInputSplit, CurrentDress changeCloths)
 {
     if (!userInputSplit[0].Contains(((int)ClothingArticle.pajamas).ToString()))
     {
         changeCloths.Dress = changeCloths.Dress + ", fail";
         return(true);
     }
     return(false);
 }
Esempio n. 4
0
 public static bool NotWearingShoesBeforeSocks(int shoeIndex, int socksIndex, CurrentDress changeCloths)
 {
     if (shoeIndex < socksIndex)
     {
         changeCloths.Dress = changeCloths.Dress + ", fail";
         return(true);
     }
     return(false);
 }
Esempio n. 5
0
 public static bool NotWearingSocksOrJacket(string userInputData, CurrentDress changeCloths)
 {
     if (!userInputData.Contains(((int)ClothingArticle.socks).ToString()) ||
         !userInputData.Contains(((int)ClothingArticle.jacket).ToString()))
     {
         changeCloths.Dress = changeCloths.Dress + ", fail";
         return(true);
     }
     return(false);
 }
Esempio n. 6
0
 public static bool CheckInputHasReqNumb(string userInputCopy, CurrentDress changeCloths)
 {
     if (!userInputCopy.Contains(((int)ClothingArticle.legWear).ToString()) ||
         !userInputCopy.Contains(((int)ClothingArticle.shirt).ToString()) ||
         !userInputCopy.Contains(((int)ClothingArticle.headWear).ToString()) ||
         !userInputCopy.Contains(((int)ClothingArticle.footWear).ToString()))
     {
         changeCloths.Dress = changeCloths.Dress + ", fail";
         return(true);
     }
     return(false);
 }
Esempio n. 7
0
        public static bool LeaveHouseAfterClothsOn(string[] userInputSplit, CurrentDress changeCloths)
        {
            int placeHolder = (userInputSplit.Length) - 1;

            if (!userInputSplit[placeHolder].Contains(
                    ClothingArticle.leaveHouse.GetHashCode().ToString()))
            {
                changeCloths.Dress = changeCloths.Dress + ", fail";
                return(true);
            }
            return(false);
        }
Esempio n. 8
0
        public static bool IsWearingShirtBeforeGlasses(string userInputData, CurrentDress changeCloths)
        {
            int headWearIndex = userInputData.IndexOf(((int)ClothingArticle.headWear).ToString());
            int shirtIndex    = userInputData.IndexOf(((int)ClothingArticle.legWear).ToString());

            if (headWearIndex < shirtIndex)
            {
                changeCloths.Dress = changeCloths.Dress + ", fail";
                return(true);
            }
            return(false);
        }
Esempio n. 9
0
        public static bool AreHotClothsWornCorrectOrder(string userInputData, CurrentDress changeCloths)
        {
            if (userInputData.Contains("hot"))
            {
                if (NotAttemptingToWearSocksOrJacket(userInputData, changeCloths) ||
                    IsWearingShirtBeforeGlasses(userInputData, changeCloths))
                {
                    return(true);
                }
            }

            return(false);
        }
Esempio n. 10
0
        public static bool NotWearingJacketBeforeShirt(string userInputData, CurrentDress changeCloths)
        {
            int jacketIndex    = userInputData.IndexOf(((int)ClothingArticle.jacket).ToString());
            int shirtIndex2    = userInputData.IndexOf(((int)ClothingArticle.shirt).ToString());
            int headWearIndex2 = userInputData.IndexOf(((int)ClothingArticle.headWear).ToString());

            if (jacketIndex < shirtIndex2 &&
                headWearIndex2 < shirtIndex2)
            {
                changeCloths.Dress = changeCloths.Dress + ", fail";
                return(true);
            }
            return(false);
        }
Esempio n. 11
0
        public static bool IsShoeWornBeforePants(string userInputCopy, int shoeIndex, CurrentDress changeCloths)
        {
            int leggingIndex = userInputCopy.IndexOf(((int)ClothingArticle.legWear).ToString());

            if (shoeIndex < leggingIndex)
            {
                changeCloths.Dress = changeCloths.Dress + ", fail";
                return(true);
            }
            return(false);
        }
Esempio n. 12
0
        public static bool ColdHotClothBreakConditions(string userInputData, string methodResults, CurrentDress changeCloths)
        {
            string dupEntryResult = methodResults.Substring(methodResults.IndexOf(", ") + 2, 1);
            int    dupEntryValue  = Convert.ToInt32(dupEntryResult);

            if (DoesInputHaveDupNumbers(dupEntryValue, changeCloths) ||
                IsInputStrTooShort(methodResults.Remove(methodResults.IndexOf(", ")).Split(','), changeCloths))
            {
                return(true);
            }

            string[] userInputSplit = userInputData.Split(',');

            if (LeaveHouseAfterClothsOn(userInputSplit, changeCloths) ||
                IsShoeWornBeforePants(userInputData, Int32.Parse(userInputData.IndexOf(((int)ClothingArticle.footWear).ToString()).ToString()), changeCloths) ||
                CheckInputHasReqNumb(userInputData, changeCloths) ||
                DoesInputStartsWithNum8(methodResults.Remove(methodResults.IndexOf(", ")).Split(','), changeCloths))
            {
                return(true);
            }
            return(false);
        }
Esempio n. 13
0
 public static bool AreColdClothsWornCorrectOrder(string userInputData, int shoeIndex, CurrentDress changeCloths)
 {
     if (userInputData.Contains("cold"))
     {
         int socksIndex = userInputData.IndexOf(((int)ClothingArticle.socks).ToString());
         if (NotWearingShoesBeforeSocks(shoeIndex, socksIndex, changeCloths) ||
             NotWearingSocksOrJacket(userInputData, changeCloths) ||
             NotWearingJacketBeforeShirt(userInputData, changeCloths))
         {
             return(true);
         }
     }
     return(false);
 }
Esempio n. 14
0
 private static CurrentDress GetClothsForCorrect(string userInput, IList <string> hotCloths, IList <string> coldCloths)
 {
     return(userInput.Contains("hot")
         ? CurrentDress.SortCloths(userInput, hotCloths)
         : CurrentDress.SortCloths(userInput, coldCloths));
 }