Наследование: MonoBehaviour
Пример #1
0
        private ComboList LoadDataSources(ProviderType currentProvider)
        {
            if (this.mruConnections == null)
            {
                return(new ComboList());
            }


            var datasources = mruConnections.FindDatasources(currentProvider);

            if (datasources == null)
            {
                return(new ComboList());
            }

            List <string> datasourceNames = new List <string>();

            foreach (var datasource in datasources.Datasource)
            {
                string dsAddress = datasource.Address;
                if (!datasourceNames.Contains(dsAddress))
                {
                    datasourceNames.Add(dsAddress);
                }
            }

            ComboList cl = new ComboList(datasourceNames);

            return(cl);
        }
Пример #2
0
        private ComboList LoadCatalogs(ProviderType currentProvider, string currentDatasource)
        {
            if (this.mruConnections == null)
            {
                return(new ComboList());
            }

            var datasource = mruConnections.FindDatasourceByAddress(currentProvider, currentDatasource);

            if (datasource == null)
            {
                return(new ComboList());
            }

            var catalogNames = new List <string>();

            foreach (var catalog in datasource.Catalogs)
            {
                if (!catalogNames.Contains(catalog))
                {
                    catalogNames.Add(catalog);
                }
            }

            ComboList cl = new ComboList(catalogNames);

            return(cl);
        }
Пример #3
0
        public static void Main(string[] args)
        {
            Uploader  upload    = new Uploader();
            ComboList comboList = upload.parseCsvAndMap(@"E:\Users\afbooza\Desktop\songlist\uploadTest.xlsx");

            CreateWebHostBuilder(args).Build().Run();
        }
Пример #4
0
        public ComboList parseCsvAndMap(string filePath)
        {
            ComboList   comboList = new ComboList();
            List <Play> plays     = new List <Play>();
            List <Song> songs     = new List <Song>();

            System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance);
            using (var stream = File.Open(filePath, FileMode.Open, FileAccess.Read))
            {
                using (IExcelDataReader reader = ExcelReaderFactory.CreateReader(stream))
                {
                    var conf = new ExcelDataSetConfiguration
                    {
                        ConfigureDataTable = _ => new ExcelDataTableConfiguration
                        {
                            UseHeaderRow = true
                        }
                    };

                    var dataSet   = reader.AsDataSet(conf);
                    var dataTable = dataSet.Tables[0];

                    DataNamesMapper <Song> mapper     = new DataNamesMapper <Song>();
                    DataNamesMapper <Play> playMapper = new DataNamesMapper <Play>();
                    plays = playMapper.Map(dataTable).ToList();
                    songs = mapper.Map(dataTable).ToList();
                }
            }

            comboList.plays = plays;
            comboList.songs = songs;


            return(comboList);
        }
Пример #5
0
	public static void AddButton(ComboList box, string text)
	{
		//Debug.Log("Adding button...");
		GameObject panel = box.transform.FindChild("Panel").gameObject;
		List<GameObject> children = new List<GameObject>(box.transform.FindChild("Panel").childCount);
		for (int i = 0; i < box.transform.FindChild("Panel").childCount; i++)
			children.Add(panel.transform.GetChild(i).gameObject);
		if (children.Exists(child => child.transform.FindChild("Text").GetComponent<Text>().text == text)) return;
		GameObject newButton = GameObject.Instantiate(box.transform.FindChild("ComboButton").gameObject) as GameObject;
		newButton.SetActive(true);
		GameObject parent = box.transform.parent.gameObject;
		float canvasScaleFactor = box.RootCanvas.GetComponent<Canvas>().scaleFactor;
		newButton.transform.SetParent(box.gameObject.transform.FindChild("Panel"));	
		newButton.GetComponent<Button>().onClick.RemoveAllListeners();
		newButton.GetComponent<Button>().onClick.AddListener(() => box.comboButtonPressed(newButton));
		newButton.transform.FindChild("Text").GetComponent<Text>().text = text;
		RectTransform buttonTransform = newButton.GetComponent<RectTransform>();
		RectTransform panelTransform = box.gameObject.transform.FindChild("Panel").gameObject.GetComponent<RectTransform>();
		Rect buttonRect = buttonTransform.rect;
		Rect panelRect = panelTransform.rect;
		//float distance = box.ButtonDistance / canvasScaleFactor;
		//Debug.Log(distance);
		float offset = buttonRect.height * (box.buttons.Count); //+ distance;
		Vector2 panelPos = panelTransform.anchoredPosition;
		//Debug.Log(panelPos);
		Vector2 buttonPos = new Vector2(panelTransform.anchoredPosition.x, panelTransform.anchoredPosition.y - offset);
		//Debug.Log (buttonPos);
		buttonTransform.anchoredPosition = buttonPos;
		float newHeigth = buttonRect.height * (box.buttons.Count + 1.0f);// + distance;
		panelTransform.sizeDelta = new Vector2(panelRect.width, newHeigth);
		newButton.transform.localScale = newButton.transform.localScale * canvasScaleFactor;
		box.buttons.Add(newButton);
	}
Пример #6
0
 public void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
     }
 }
Пример #7
0
    void Start()
    {
        partSys           = GetComponent <ParticleSystem>();
        colorOverLifetime = partSys.colorOverLifetime;
        partRenderer      = GetComponent <ParticleSystemRenderer>();

        combo = PlayerController.main.gameObject.GetComponent <ComboList>();
    }
Пример #8
0
        public string GetRandomCombo(ComboList combos = null)
        {
            if (combos == null)
            {
                combos = _runLists.Combos;
            }

            return(combos[_random.Next(combos.Count)]);
        }
Пример #9
0
        public ComboDialog(string[] Options)
        {
            Build();

            SelectedOption = null;
            foreach (var Option in Options)
            {
                ComboList.AppendText(Option);
            }
        }
Пример #10
0
        public string GetRandomCombo(ComboList combos = null)
        {
            _runLists = RunLists.GetOrNewInstance();

            if (combos == null)
            {
                combos = _runLists.combos;
            }

            return(combos[random.Next(combos.Count)]);
        }
Пример #11
0
 void Awake()
 {
     ac           = GetComponent <ActionList>();
     cl           = GetComponent <CreatureList>();
     cmbs         = GetComponent <ComboList>();
     canAddAction = true;
     combosforcheck.Add(deepBreath);
     combosforcheck.Add(standYourGround);
     combosforcheck.Add(flyingKick);
     combosforcheck.Add(uppercut);
 }
Пример #12
0
 // Use this for initialization
 void Start()
 {
     circleCollider           = GameObject.Find("AttackRadius").GetComponent <CircleCollider2D>();
     boxCollider              = GetComponent <BoxCollider2D>();
     comboListScript          = GetComponent <ComboList>();
     dodgeCooldownStore       = dodgeCooldown;
     attackDelayStore         = attackDelay;
     comboExecutionDelayStore = comboExecutionDelay;
     isAttacking              = false;
     isFalling       = false;
     lastKeysPressed = new KeyCode[5];
 }
Пример #13
0
 /// <summary>
 /// Writes options to the solution file.
 /// </summary>
 public void SaveOptions(Stream Stream)
 {
     using (BinaryWriter Writer = new BinaryWriter(Stream))
     {
         string[] CommandLines = ComboList.ToArray();
         Writer.Write(CommandLines.Length);
         for (int CommandLineIdx = 0; CommandLineIdx < CommandLines.Length; CommandLineIdx++)
         {
             Writer.Write(CommandLines[CommandLineIdx]);
         }
     }
 }
Пример #14
0
 /// <summary>
 /// Reads options out of the solution file.
 /// </summary>
 public void LoadOptions(Stream Stream)
 {
     using (BinaryReader Reader = new BinaryReader(Stream))
     {
         List <string> CommandLines = new List <string>();
         int           Count        = Reader.ReadInt32();
         for (int CommandLineIdx = 0; CommandLineIdx < Count; CommandLineIdx++)
         {
             CommandLines.Add(Reader.ReadString());
         }
         ComboList.Clear();
         ComboList.AddRange(CommandLines.ToArray());
     }
 }
Пример #15
0
        private static ComboList GetCombos(PartList parts, Item board, double cumilativeArea = 0, double minimumArea = 0)
        {
            PartList  mycopyofParts = parts.Copy();     // create a copy of the list, because we will be changing the list, but not the contents
            ComboList myCombos      = new ComboList();  // collection of all the combinations we could construct

            // loop though all the parts ...
            foreach (var ipart in parts)
            {
                if (!board.BiggerThan(ipart))            // rule out parts that are too long/wide
                {
                    mycopyofParts.Remove(ipart);
                    continue;
                }

                double ncumArea = ipart.Area + cumilativeArea;
                if (ncumArea > board.Area)              // dont add parts that would push the cumilative area of the combination over that of the board
                {
                    continue;
                }


                if (ncumArea > minimumArea)
                {
                    myCombos.Add(new Combo(ipart));
                }

                mycopyofParts.Remove(ipart);
                if (mycopyofParts.Count == 0)
                {
                    continue;                           // no need to try call myself again if there is no parts left
                }
                ComboList sublist = GetCombos(mycopyofParts, board, ncumArea, minimumArea);
                foreach (var icombo in sublist)
                {
                    double cumsubArea = icombo.CumalativeArea + ncumArea;
                    icombo.Add(ipart);

                    if (icombo.Count > 1 && icombo[0].Width + icombo[1].Width > board.Width && icombo[0].Length + icombo[1].Length > board.Length)
                    {
                        continue;
                    }

                    myCombos.Add(icombo);
                }
            }

            return(myCombos);
        }
Пример #16
0
 private void CommitCommandLineToMRU(string CommandLine)
 {
     if (0 < CommandLine.Length)
     {
         // Maintain the MRU history
         // Adds the entered command line to the top of the list
         // Moves it to the top if it's already in the list
         // Trims the list to the max length if it's too big
         ComboList.RemoveAll(s => 0 == string.Compare(s, CommandLine));
         ComboList.Insert(0, CommandLine);
         if (ComboList.Count > ComboListCountMax)
         {
             ComboList.RemoveAt(ComboList.Count - 1);
         }
     }
 }
Пример #17
0
        private void cmbSizeSet_SelectedIndexChanged(object sender, EventArgs e)
        {
            ComboList thisControl = (ComboList)sender;

            if (thisControl.SelectedValue == null)
            {
                return;
            }
            string temp = thisControl.Name.Substring(thisControl.Name.Length - 1);

            if (int.TryParse(temp, out int index) == false)
            {
                return;
            }
            if (int.TryParse(inbSets[index].Text, out int sets) == false)
            {
                sets = 0;
            }
            showSizeUnit(index, ((SizeSetView)BsSizeSets[index].Current).sizeUnits, sets);
        }
Пример #18
0
    public ComboList ToComboList()
    {
        ComboList list = new ComboList();

        List <ComboSequence> sequences = new List <ComboSequence>();

        foreach (ComboSequenceConfig sequenceConfig in m_Sequences)
        {
            ComboSequence sequence = new ComboSequence();
            sequence.m_ComboName = sequenceConfig.m_ComboName;

            List <CombatCommand> combatSequence = new List <CombatCommand>();
            foreach (string command in sequenceConfig.m_ComboSequence)
            {
                combatSequence.Add((CombatCommand)Enum.Parse(typeof(CombatCommand), command));
            }
            sequence.m_Combo = combatSequence.ToArray();

            sequences.Add(sequence);
        }

        list.m_Sequences = sequences.ToArray();
        return(list);
    }
Пример #19
0
        /// Called by combo control to populate the drop-down list
        private void ComboListHandler(object Sender, EventArgs Args)
        {
            var OleArgs = (OleMenuCmdEventArgs)Args;

            Marshal.GetNativeVariantForObject(ComboList.ToArray(), OleArgs.OutValue);
        }
 private void PopulateLists()
 {
     ComboList.Add(new CribbageCombos()
     {
         CardsToUse = 2, Description = "Fifteens", Points = 2, NumberNeeded = 15
     });
     ComboList.Add(new CribbageCombos()
     {
         CardsToUse = 5, Description = "Full House", IsFullHouse = true, Group = EnumScoreGroup.ScorePairRuns, Points = 5
     });
     ComboList.Add(new CribbageCombos()
     {
         CardsToUse = 2, Description = "Pairs", Group = EnumScoreGroup.ScorePairRuns, Points = 2, NumberForKind = 2
     });
     ComboList.Add(new CribbageCombos()
     {
         CardsToUse = 3, Description = "Three of a kind", Group = EnumScoreGroup.ScorePairRuns, NumberForKind = 3, Points = 6
     });
     ComboList.Add(new CribbageCombos()
     {
         CardsToUse = 4, Description = "Four Of a Kind", Group = EnumScoreGroup.ScorePairRuns, NumberForKind = 4, Points = 12
     });
     ComboList.Add(new CribbageCombos()
     {
         CardsToUse = 3, Description = "Run of three", Group = EnumScoreGroup.ScorePairRuns, NumberInStraight = 3, Points = 3
     });
     ComboList.Add(new CribbageCombos()
     {
         CardsToUse = 4, Description = "Run of four", Group = EnumScoreGroup.ScorePairRuns, NumberInStraight = 4, Points = 4
     });
     ComboList.Add(new CribbageCombos()
     {
         CardsToUse = 5, Description = "Run of five", Group = EnumScoreGroup.ScorePairRuns, NumberInStraight = 5, Points = 5
     });
     ComboList.Add(new CribbageCombos()
     {
         CardsToUse = 4, Description = "Double run of three", Group = EnumScoreGroup.ScorePairRuns, NumberInStraight = 3, NumberForKind = 2, Points = 8
     });
     ComboList.Add(new CribbageCombos()
     {
         CardsToUse = 5, Description = "Double run of four", Group = EnumScoreGroup.ScorePairRuns, NumberInStraight = 4, NumberForKind = 2, Points = 10
     });
     ComboList.Add(new CribbageCombos()
     {
         CardsToUse = 5, Description = "Triple run of three", Group = EnumScoreGroup.ScorePairRuns, NumberForKind = 3, NumberInStraight = 3, Points = 15
     });
     ComboList.Add(new CribbageCombos()
     {
         CardsToUse = 5, Description = "Quadruple run of three", Group = EnumScoreGroup.ScorePairRuns, NumberForKind = 2, NumberInStraight = 3, DoublePairNeeded = true, Points = 16
     });
     ComboList.Add(new CribbageCombos()
     {
         CardsToUse = 4, Description = "Four cards of same suit", IsFlush = true, Group = EnumScoreGroup.ScoreFlush, Points = 4
     });
     ComboList.Add(new CribbageCombos()
     {
         CardsToUse = 5, Description = "Five cards of same suit", IsFlush = true, Group = EnumScoreGroup.ScoreFlush, Points = 5
     });
     ComboList.Add(new CribbageCombos()
     {
         CardsToUse = 1, Description = "Jack of same suit", Points = 1, JackStatus = EnumJackType.Nob
     });
     ComboList.Add(new CribbageCombos()
     {
         CardsToUse = 1, Description = "Same suit as starter jack", Points = 2, JackStatus = EnumJackType.Heels
     });
 }
Пример #21
0
 public static void printComboList(ComboList list)
 {
   if (list != null)
     Debug.Log(list.comboListToString());
 }
Пример #22
0
 public static void Reset(ComboList box)
 {
   box.Reset();
 }
Пример #23
0
	public static void RemoveButton(ComboList box, string text)
	{
		Transform panelTransform = box.transform.FindChild("Panel");
		List<GameObject> children = new List<GameObject>(panelTransform.childCount);
		GameObject header = box.transform.FindChild("ComboButton").gameObject;
		//float canvasScaleFactor = box.RootCanvas.GetComponent<Canvas>().scaleFactor;
		for (int i = 0; i < panelTransform.childCount; i++)
			children.Add(panelTransform.GetChild(i).gameObject);
		if (!children.Exists(child => child.transform.FindChild("Text").GetComponent<Text>().text == text)) return;
		GameObject removingObject = 
			children.Find(button => button.transform.FindChild("Text").GetComponent<Text>().text.Equals(text));
		RectTransform buttonTransform = removingObject.GetComponent<RectTransform>();
		RectTransform panelRectTransform = box.gameObject.transform.FindChild("Panel").gameObject.GetComponent<RectTransform>();
		Rect panelRect = panelRectTransform.rect;
		Rect buttonRect = buttonTransform.rect;
		float buttonHeight = buttonRect.height;
		children.Clear();
		box.buttons.Remove(removingObject);
		GameObject.DestroyImmediate(removingObject);
		//float distance = box.ButtonDistance / canvasScaleFactor;
		for (int i = 0; i < panelTransform.childCount; i++)
			children.Add(panelTransform.GetChild(i).gameObject);
		for (int i = 0; i < children.Count; i++)
		{
			float offset = buttonHeight * i; //+ distance;
			Vector2 buttonPos = new Vector2(panelRectTransform.anchoredPosition.x, panelRectTransform.anchoredPosition.y - offset);
			RectTransform childTransform = panelTransform.GetChild(i).gameObject.GetComponent<RectTransform>();
			childTransform.anchoredPosition = buttonPos;	
		}
		float newHeigth = buttonRect.height * children.Count; //+ distance;
		panelRectTransform.sizeDelta = new Vector2(panelRectTransform.rect.width, newHeigth);
	}
 private void PersonRegistration_Load(object sender, EventArgs e)
 {
     FillGrid(String.Empty);
     ComboList.FillCarType(cmbAutoType);
     ComboList.FillDriverType(cmbDriverType);
 }
Пример #25
0
        /// <summary>
        /// Handles filtering on search and filter post request.
        /// </summary>
        public void OnPost()
        {
            Menu = new Menu();

            ComboList  = Menu.AvailableCombos;
            EntreeList = Menu.AvailableEntrees;
            SideList   = Menu.AvailableSides;
            DrinkList  = Menu.AvailableDrinks;

            if (search != null)
            {
                ComboList = ComboList.Where(item =>
                                            (item as CretaceousCombo).Description.IndexOf(search, StringComparison.OrdinalIgnoreCase) >= 0 ||
                                            (item as CretaceousCombo).Side.Description.IndexOf(search, StringComparison.OrdinalIgnoreCase) >= 0 ||
                                            (item as CretaceousCombo).Drink.Description.IndexOf(search, StringComparison.OrdinalIgnoreCase) >= 0 ||
                                            (item as CretaceousCombo).Ingredients.Contains(search, StringComparer.OrdinalIgnoreCase));

                EntreeList = EntreeList.Where(item =>
                                              (item as IOrderItem).Description.IndexOf(search, StringComparison.OrdinalIgnoreCase) >= 0 ||
                                              item.Ingredients.Contains(search, StringComparer.OrdinalIgnoreCase));

                SideList = SideList.Where(item =>
                                          (item as IOrderItem).Description.IndexOf(search, StringComparison.OrdinalIgnoreCase) >= 0 ||
                                          item.Ingredients.Contains(search, StringComparer.OrdinalIgnoreCase));

                DrinkList = DrinkList.Where(item =>
                                            (item as IOrderItem).Description.IndexOf(search, StringComparison.OrdinalIgnoreCase) >= 0 ||
                                            item.Ingredients.Contains(search, StringComparer.OrdinalIgnoreCase));
            }

            if (menuCategory.Count > 0)
            {
                ComboList  = ComboList.Where(item => menuCategory.Contains("Combo"));
                EntreeList = EntreeList.Where(item => menuCategory.Contains("Entree"));
                SideList   = SideList.Where(item => menuCategory.Contains("Side"));
                DrinkList  = DrinkList.Where(item => menuCategory.Contains("Drink"));
            }

            if (minimumPrice is float minP)
            {
                ComboList  = ComboList.Where(item => item.Price > minP);
                EntreeList = EntreeList.Where(item => item.Price > minP);
                SideList   = SideList.Where(item => item.Price > minP);
                DrinkList  = DrinkList.Where(item => item.Price > minP);
            }

            if (maximumPrice is float maxP)
            {
                ComboList  = ComboList.Where(item => item.Price < maxP);
                EntreeList = EntreeList.Where(item => item.Price < maxP);
                SideList   = SideList.Where(item => item.Price < maxP);
                DrinkList  = DrinkList.Where(item => item.Price < maxP);
            }

            if (excludedIngredients.Count > 0)
            {
                ComboList = ComboList.Where(item =>
                {
                    bool contains = false;

                    foreach (string ingredient in excludedIngredients)
                    {
                        if (item.Ingredients.Contains(ingredient, StringComparer.OrdinalIgnoreCase))
                        {
                            contains = true;
                        }
                    }

                    return(!contains);
                });

                EntreeList = EntreeList.Where(item =>
                {
                    bool contains = false;

                    foreach (string ingredient in excludedIngredients)
                    {
                        if (item.Ingredients.Contains(ingredient, StringComparer.OrdinalIgnoreCase))
                        {
                            contains = true;
                        }
                    }

                    return(!contains);
                });

                SideList = SideList.Where(item =>
                {
                    bool contains = false;

                    foreach (string ingredient in excludedIngredients)
                    {
                        if (item.Ingredients.Contains(ingredient, StringComparer.OrdinalIgnoreCase))
                        {
                            contains = true;
                        }
                    }

                    return(!contains);
                });

                DrinkList = DrinkList.Where(item =>
                {
                    bool contains = false;

                    foreach (string ingredient in excludedIngredients)
                    {
                        if (item.Ingredients.Contains(ingredient, StringComparer.OrdinalIgnoreCase))
                        {
                            contains = true;
                        }
                    }

                    return(!contains);
                });
            }
        }
Пример #26
0
 // -Public API-
 public void SetCombos(ComboList combos)
 {
     m_Combos = combos;
 }
        private CustomBasicCollection <CribbageCombos> ListCribbageCombos(IDeckDict <CribbageCard> thisCol, bool fromCrib)
        {
            CustomBasicCollection <CribbageCombos> output = new CustomBasicCollection <CribbageCombos>();
            var  mostSuits = thisCol.GroupOrderDescending(items => items.Suit);
            bool hadFourFlush;
            bool hadFiveFlush;
            var  startCard = StartCard();

            startCard.HasUsed = false;
            thisCol.ForEach(thisCard => thisCard.HasUsed = false);

            if (mostSuits.First().Count() == 4 && startCard.Suit == mostSuits.First().Key)
            {
                hadFiveFlush = true;
                hadFourFlush = false;
            }
            else if (mostSuits.First().Count() == 4 && fromCrib == false)
            {
                hadFourFlush = true;
                hadFiveFlush = false; //originally was true.
            }
            else
            {
                hadFourFlush = false;
                hadFiveFlush = false;
            }
            bool           hadMultiMove = false;
            int            pairss       = 0;
            bool           hadLongerRun = false;
            bool           hadStraight  = false;
            bool           hadKind      = false;
            int            fifs;
            CribbageCombos newCombo;

            ComboList.ForEach(thisCombo =>
            {
                if (thisCombo.NumberNeeded == 15)
                {
                    fifs = Find15Combos(thisCol);
                    if (fifs > 0)
                    {
                        newCombo             = new CribbageCombos();
                        newCombo.Description = "Fifteens";
                        newCombo.Points      = fifs * 2;
                        output.Add(newCombo);
                    }
                }
                else if (thisCombo.IsFlush == true)
                {
                    if (thisCombo.CardsToUse == 5 && hadFiveFlush == true)
                    {
                        output.Add(thisCombo);
                    }
                    else if (thisCombo.CardsToUse == 4 && hadFourFlush == true)
                    {
                        output.Add(thisCombo);
                    }
                }

                else if (thisCombo.JackStatus == EnumJackType.Nob)
                {
                    if (thisCol.Any(items => items.Value == EnumCardValueList.Jack && items.Suit == startCard.Suit && startCard.Value != EnumCardValueList.Jack))
                    {
                        output.Add(thisCombo);
                    }
                }
                else if (thisCombo.JackStatus == EnumJackType.Heels)
                {
                    if (thisCol.Any(items => items.Suit == startCard.Suit && startCard.Value == EnumCardValueList.Jack))
                    {
                        output.Add(thisCombo);
                    }
                }
                else if (thisCombo.IsFullHouse)
                {
                    if (HadFullHouse(thisCol))
                    {
                        output.Add(thisCombo);
                    }
                }

                else if (thisCombo.NumberForKind > 0 && thisCombo.NumberInStraight > 0)
                {
                    if (hadMultiMove == false)
                    {
                        hadMultiMove = IsMultiMove(thisCombo, thisCol);
                        if (hadMultiMove == true)
                        {
                            output.Add(thisCombo);
                        }
                    }
                }

                else if (thisCombo.NumberInStraight == 4 && hadLongerRun == true)
                {
                    output.Add(thisCombo);
                }
                else if (thisCombo.NumberInStraight > 0)
                {
                    hadStraight = HadProperStraight(thisCol, thisCombo);
                    if (hadStraight == true)
                    {
                        output.Add(thisCombo);
                    }
                }
                else if (thisCombo.NumberForKind > 2)
                {
                    hadKind = HadProperKind(thisCol, thisCombo);
                    if (hadKind == true)
                    {
                        output.Add(thisCombo);
                    }
                }
                else if (thisCombo.NumberForKind == 2)
                {
                    pairss = HowManyPairs(thisCol);
                    if (pairss > 0)
                    {
                        newCombo             = new CribbageCombos();
                        newCombo.Description = thisCombo.Description;
                        newCombo.Points      = pairss * thisCombo.Points;
                        output.Add(newCombo);
                    }
                }
                else
                {
                    throw new BasicBlankException("Combo Not Supported.  Rethink");
                }
            });
            if (output.Any(items => items.Points == 8))
            {
                if (output.Any(items => items.Points == 3 && items.NumberInStraight == 3))
                {
                    output.RemoveAllOnly(items => items.Points == 3 && items.NumberInStraight == 3); //because you got the double run of 3.
                }
            }
            return(output);
        }
Пример #28
0
 // Use this for initialization
 void Start()
 {
     cl        = PlayerController.main.gameObject.GetComponent <ComboList>();
     ce        = PlayerController.main.gameObject.GetComponentInChildren <ComboEffect>();
     startTime = Time.time;
 }