void UpdateSelectable()
    {
        List <KMSelectable> Children = new List <KMSelectable>();

        if (!Game.Solved)
        {
            foreach (Cell cell in Game.Cells)
            {
                if (StartFound)
                {
                    Children.Add(!cell.Dug || (cell.Number > 0 && Digging) ? cell._selectable : null);
                }
                else
                {
                    Children.Add(Picks.Contains(cell) ? cell._selectable : null);
                }
            }
        }

        if (StartFound)
        {
            Children.Add(ModeToggle.GetComponent <KMSelectable>());
        }

        foreach (KMSelectable selectable in GetComponentsInChildren <KMSelectable>().Except(new KMSelectable[] { ModuleSelectable }))
        {
            selectable.Highlight.gameObject.SetActive(Children.IndexOf(selectable) > -1);
        }

        ModuleSelectable.Children = Children.ToArray();
        ModuleSelectable.UpdateChildren(null);
    }
Esempio n. 2
0
        public string QuickPicks(int max, int picks, int pbmax, string faves, int pbfave, int tix)
        {
            Log.WriteLog(new LogEvent(string.Format("QuickPickService - QuickPicks()"), "Start"));

            Tickets tixs = new Tickets();

            tixs.tickets = new List <Ticket>();

            try
            {
                tix   = fixTix(tix);
                faves = fixParam(faves);

                while (tix-- > 0)
                {   //int max, int picks, int pbmax, string faves, int pbfave
                    tixs.tickets.Add(Picks.GetPicks(max, picks, pbmax, faves, pbfave));
                }
            }
            catch (Exception ex)
            {
                return("Server was not able to process your request " + ex.Message);
            }

            string json = JsonConvert.SerializeObject(tixs.tickets);

            json = json.Replace(",\"pBall\":0", "").Replace(",\"id\":0", "");

            WebOperationContext.Current.OutgoingResponse.Headers.Add("Access-Control-Allow-Origin", "*");
            WebOperationContext.Current.OutgoingResponse.ContentType = "application/json";
            return(json);
        }
 private void Button_Click_2(object sender, RoutedEventArgs e) //Scissors
 {
     inputComputer = (Picks)rng.Next(1, 5);
     inputPlayer   = (Picks)3;
     if (inputComputer == inputPlayer)
     {
         MessageBox.Show("It's a draw!");
     }
     else if (inputComputer == (Picks)2)
     {
         MessageBox.Show("Scissors cuts paper, player wins!");
         playerScore++;
         Score.Text = $"{computerScore} || {playerScore}";
     }
     else if (inputComputer == (Picks)1)
     {
         MessageBox.Show("Rock crushes scissors, computer wins!");
         computerScore++;
         Score.Text = $"{computerScore} || {playerScore}";
     }
     else if (inputComputer == (Picks)4)
     {
         MessageBox.Show("Scissors decapitates lizard, player wins!");
         playerScore++;
         Score.Text = $"{computerScore} || {playerScore}";
     }
     else if (inputComputer == (Picks)5)
     {
         MessageBox.Show("Spock smashes scissors, computer wins!");
         computerScore++;
         Score.Text = $"{computerScore} || {playerScore}";
     }
 }
 private void Button_Click_1(object sender, RoutedEventArgs e) //Paper
 {
     inputComputer = (Picks)rng.Next(1, 5);
     inputPlayer   = (Picks)2;
     if (inputComputer == inputPlayer)
     {
         MessageBox.Show("It's a draw!");
     }
     else if (inputComputer == (Picks)1)
     {
         MessageBox.Show("Player wins, paper covers the rock!");
         playerScore++;
         Score.Text = $"{computerScore} || {playerScore}";
     }
     else if (inputComputer == (Picks)3)
     {
         MessageBox.Show("Scissors cuts paper, computer wins!");
         computerScore++;
         Score.Text = $"{computerScore} || {playerScore}";
     }
     else if (inputComputer == (Picks)4)
     {
         MessageBox.Show("Lizard eats paper, computer wins!");
         computerScore++;
         Score.Text = $"{computerScore} || {playerScore}";
     }
     else if (inputComputer == (Picks)5)
     {
         MessageBox.Show("Paper disproves spock, player wins!");
         playerScore++;
         Score.Text = $"{computerScore} || {playerScore}";
     }
 }
 private void Button_Click(object sender, RoutedEventArgs e) //Rock
 {
     inputComputer = (Picks)rng.Next(1, 5);
     inputPlayer   = (Picks)1;
     if (inputComputer == inputPlayer)
     {
         MessageBox.Show("It's a draw!");
     }
     else if (inputComputer == (Picks)2)
     {
         MessageBox.Show("Computer wins, paper covers the rock!");
         computerScore++;
         Score.Text = $"{computerScore} || {playerScore}";
     }
     else if (inputComputer == (Picks)3)
     {
         MessageBox.Show("Rock crushes scissors, player wins!");
         playerScore++;
         Score.Text = $"{computerScore} || {playerScore}";
     }
     else if (inputComputer == (Picks)4)
     {
         MessageBox.Show("Rock crushes lizard, player wins!");
         playerScore++;
         Score.Text = $"{computerScore} || {playerScore}";
     }
     else if (inputComputer == (Picks)5)
     {
         MessageBox.Show("Spock vaporizes rock, computer wins!");
         computerScore++;
         Score.Text = $"{computerScore} || {playerScore}";
     }
 }
 private void Button_Click_3(object sender, RoutedEventArgs e) //Spock
 {
     inputComputer = (Picks)rng.Next(1, 5);
     inputPlayer   = (Picks)5;
     if (inputComputer == inputPlayer)
     {
         MessageBox.Show("It's a draw!");
     }
     else if (inputComputer == (Picks)1)
     {
         MessageBox.Show("Spock vaporizes rock, player wins!");
         playerScore++;
         Score.Text = $"{computerScore} || {playerScore}";
     }
     else if (inputComputer == (Picks)2)
     {
         MessageBox.Show("Paper disproves spock, computer wins!");
         computerScore++;
         Score.Text = $"{computerScore} || {playerScore}";
     }
     else if (inputComputer == (Picks)3)
     {
         MessageBox.Show("Spock smashes scissors, player wins!");
         playerScore++;
         Score.Text = $"{computerScore} || {playerScore}";
     }
     else if (inputComputer == (Picks)4)
     {
         MessageBox.Show("Lizard poisons spock, computer wins!");
         computerScore++;
         Score.Text = $"{computerScore} || {playerScore}";
     }
 }
Esempio n. 7
0
        public List <decimal> GetPickValues(bool sort = false)
        {
            List <decimal> values = Picks.Select(x => x.ToDecimal()).ToList();

            if (sort)
            {
                values.Sort();
            }
            return(values);
        }
Esempio n. 8
0
        //----==== PROTECTED METHODS ====----------------------------------------------------------

        /// <summary>
        /// Copy all of the base stuff into the concrete clone passed in.
        /// </summary>
        /// <param name="clone"></param>
        /// <returns></returns>
        protected IMiner Clone(MinerBase clone)
        {
            CloneCausedReload = false;

            // Make sure the source data is all up to date.
            // If this is the thread loading then you will wait before you clone it.
            // TODO: Possibly thread out the loading of the data.

            Load();

            // Make sure for these fields, copy to the clone and clear it from "this"

            if (CloneCausedReload)
            {
                clone.CloneCausedReload = true;
                CloneCausedReload       = false;
            }

            if (IsNewData)
            {
                clone.IsNewData = true;
                IsNewData       = false;
            }

            // Copy and fill in all of the base goodness.

            clone.Abbreviation       = Abbreviation;
            clone.CacheConfiguration = CacheConfiguration;
            clone.ContainsEstimates  = ContainsEstimates;
            //clone.CompoundLoaded = CompoundLoaded;			// Don't copy this so the compound movies are reloaded.
            clone.Expiration = Expiration;
            clone.IsHidden   = IsHidden;
            clone.LastLoaded = LastLoaded;
            clone.Name       = Name;
            clone.OkToMine   = false;                   // This is the clone of the singleton, this should prevent any reloading
            clone.Url        = Url;
            clone.UrlSource  = UrlSource;
            clone.Weight     = Weight;                  // You get the default.  :)

            // Set during the Mine() method.

            clone.Error       = Error;
            clone.ErrorDetail = ErrorDetail;

            // Create a NEW list of movies, the movie objects are still shared between this object and the cloned object.
            // (you can't just assign the list over otherwise the list will be shared too and you'll get iteration problems amongst the threads)
            // The BoxOfficeHistory should be attached to the movies if loaded.

            clone.Movies = new List <IMovie>(Movies);

            clone.Picks         = Picks?.Clone();
            clone.PicksBonusOff = PicksBonusOff?.Clone();

            return(clone);
        }
Esempio n. 9
0
 ProfilePick IPicksThisInterface.this[UGUI user, UUID id]
 {
     get
     {
         ProfilePick pick;
         if (Picks.TryGetValue(user, id, out pick))
         {
             return(pick);
         }
         throw new KeyNotFoundException();
     }
 }
 private void Button_Click_4(object sender, RoutedEventArgs e) //Lizard
 {
     inputComputer = (Picks)rng.Next(1, 5);
     inputPlayer   = (Picks)4;
     if (inputComputer == inputPlayer)
     {
         MessageBox.Show("It's a draw!");
     }
     else if (inputComputer == (Picks)1)
     {
         MessageBox.Show("Rocks crushes lizard, computer wins!");
         computerScore++;
         Score.Text = $"{computerScore} || {playerScore}";
     }
     else if (inputComputer == (Picks)2)
     {
         MessageBox.Show("Lizard eats paper, computer wins!");
         computerScore++;
         Score.Text = $"{computerScore} || {playerScore}";
     }
     else if (inputComputer == (Picks)3)
     {
         MessageBox.Show("Scissors decapitates lizard, computer wins!");
         computerScore++;
         Score.Text = $"{computerScore} || {playerScore}";
     }
     else if (inputComputer == (Picks)5)
     {
         MessageBox.Show("Lizard poisons spock, player wins!");
         playerScore++;
         Score.Text = $"{computerScore} || {playerScore}";
         if (playerScore == 5)
         {
             MessageBox.Show("PLAYER IS A WINNER!");
         }
         else if (computerScore == 5)
         {
             MessageBox.Show("COMPUTER IS A WINNER!");
         }
     }
 }
    public Score calculate(Picks picks, List <ProcessedPick> processedPicks, bool benchBoost)
    {
        // Find the footballers and tally the current score
        Score score = new Score();

        for (int i = 0; i < processedPicks.Count; i++)
        {
            var           isSub         = !benchBoost && i >= 11;
            ProcessedPick processedPick = processedPicks[i];
            Pick          pick          = processedPick.pick;
            var           gwExplains    = processedPick.footballer.rawData.explains;
            int           thisScore     = calculateFootballerScore(gwExplains) * pick.multiplier;
            if (!isSub)
            {
                score.startingScore += thisScore;
            }
            else
            {
                score.subScore += thisScore;
            }
        }
        score.startingScore -= picks != null && picks.entry_history != null ? picks.entry_history.event_transfers_cost : 0;
        return(score);
    }
Esempio n. 12
0
 public List <int> GetIntegerPickValues() => Picks.Select(x => x.ToInt()).ToList();
Esempio n. 13
0
 public void ClearPicks() => Picks.Clear();