/// <summary>
        /// Compares to.
        /// </summary>
        /// <param name="compareMode">The compare mode.</param>
        /// <param name="obj">The object.</param>
        /// <returns></returns>
        public int CompareTo(instanceCountCollectionFormulae compareMode, IInstanceCountCollection obj)
        {
            switch (compareMode)
            {
            case instanceCountCollectionFormulae.avgFrequency:
                return(avgFreq.CompareTo(obj.avgFreq));

                break;

            default:
            case instanceCountCollectionFormulae.keyCount:
                return(Count.CompareTo(obj.Count));

                break;

            case instanceCountCollectionFormulae.totalScore:
                return(TotalScore.CompareTo(obj.Count));

                break;

            case instanceCountCollectionFormulae.significance:
                return(diversityRatio.CompareTo(obj.diversityRatio));

                break;
            }
        }
        private void PopulateList()
        {
            _thisGrid !.Children.Clear();
            _thisGrid.RowDefinitions.Clear();
            if (_scoreList !.Count == 0)
            {
                return;
            }
            AddAutoRows(_thisGrid, _scoreList.Count + 1); //i learned the lesson the hard way if i forget this part.
            int x = 0;

            _scoreList.ForEach(y =>
            {
                x++;
                var thisLabel  = GetDefaultLabel();
                thisLabel.Text = $"Round {x}";
                AddControlToGrid(_thisGrid, thisLabel, x - 1, 0);
                thisLabel      = GetDefaultLabel();
                thisLabel.Text = y.ToString();
                AddControlToGrid(_thisGrid, thisLabel, x - 1, 1);
            });
            var finalLabel = GetDefaultLabel();

            finalLabel.FontWeight = FontWeights.Bold;
            finalLabel.Margin     = new Thickness(0, 10, 0, 0);
            finalLabel.Text       = "Final Score";
            AddControlToGrid(_thisGrid, finalLabel, x, 0);
            finalLabel            = GetDefaultLabel();
            finalLabel.FontWeight = FontWeights.Bold;
            finalLabel.Margin     = new Thickness(0, 10, 0, 0);
            finalLabel.Text       = _thisMod !.Scores !.TotalScore.ToString();
            AddControlToGrid(_thisGrid, finalLabel, x, 1);
        }
Ejemplo n.º 3
0
    // Start is called before the first frame update
    void Start()
    {
        PlayedScore        = 0;
        TotalScore         = 0;
        previousBoardCount = 0;
        currentBoardCount  = 0;
        //PrintScore();

        GameObject[] objs = GameObject.FindGameObjectsWithTag("ScoreText");
        // Set UI Text to objects to access
        //Debug.Log(objs.Length);
        foreach (var i in objs)
        {
            var t = i.GetComponent <Text>();
            if (t.name.Equals("HighScore"))
            {
                highScoreText = t;
            }
            if (t.name.Equals("CurrentScore"))
            {
                totalScoreText = t;
            }
        }

        // Set labels
        highScoreText.text     = HighScore.ToString();
        GameOverInfo.highScore = HighScore;
        totalScoreText.text    = TotalScore.ToString();
    }
Ejemplo n.º 4
0
        /// <summary>
        ///     使用一定的格式构造一个字符串
        /// </summary>
        /// <param name="format"></param>
        /// <param name="formatProvider"></param>
        /// <returns></returns>
        public string ToString(string format, IFormatProvider formatProvider)
        {
            var b = new StringBuilder(format);

            b.Replace("username", UserName);
            b.Replace("userid", UserId.ToString());
            b.Replace("mode", _mode.ToString());
            b.Replace("pp", Pp.ToString(CultureInfo.InvariantCulture));
            b.Replace("globalrank", GlobalRank.ToString());
            b.Replace("countryrank", CountryRank.ToString());
            b.Replace("cssh", SshCount.ToString());
            b.Replace("csh", ShCount.ToString());
            b.Replace("css", SsCount.ToString());
            b.Replace("cs", SCount.ToString());
            b.Replace("ca", ACount.ToString());
            b.Replace("acc", $"{Accuracy:f2}%");
            b.Replace("rankedscore", RankedScore.ToString(CultureInfo.InvariantCulture));
            b.Replace("totalscore", TotalScore.ToString(CultureInfo.InvariantCulture));
            b.Replace("playcount", PlayCount.ToString());
            b.Replace("level", Level.ToString(CultureInfo.InvariantCulture));
            b.Replace("countrycn", GetCountryInCn(Country));
            b.Replace("country", Country);
            b.Replace("joindate", JoinDate.ToString("yyyy/MM/dd HH:mm:ss"));
            return(b.ToString());
        }
Ejemplo n.º 5
0
 public void SetInformation(TotalScore totalScore)
 {
     TotalScore           = totalScore;
     IdText.text          = TotalScore.Email.Id.ToString(); //Might not be best to use email id here
     TotalScoreText.text  = TotalScore.CombinedScore.ToString();
     EmailInputField.text = TotalScore.Email.EmailString;
 }
Ejemplo n.º 6
0
 private void WinGameProcess()
 {
     playButtonTextLabel.text = "Play Again!";
     gameOverDisplay.gameObject.SetActive(true);
     gameOverTextLabel.text      = "You Win!";
     completedWaveTextLabel.text = (waveNumber + 1).ToString() + "/10";
     totalScoreTextLabel.text    = TotalScore.ToString();
 }
Ejemplo n.º 7
0
 private void GameOverProcess()
 {
     playButtonTextLabel.text = "play Again!";
     audioSource.PlayOneShot(SoundManager.Instance.GameOverSFX);  //plays game over sound
     gameOverDisplay.gameObject.SetActive(true);
     gameOverTextLabel.text      = "You Lose!";
     completedWaveTextLabel.text = (waveNumber + 1).ToString() + "/10";
     totalScoreTextLabel.text    = TotalScore.ToString();
 }
Ejemplo n.º 8
0
        private void SetText()
        {
            if (_currentScoreText == null || _totalScoreText == null)
            {
                return;
            }

            _currentScoreText.text = CurrentScore.ToString();
            _totalScoreText.text   = TotalScore.ToString();
        }
Ejemplo n.º 9
0
 public void AddRoundToGameScore()
 {
     foreach (var item in CurrentRoundScore)
     {
         if (!TotalScore.ContainsKey(item.Key))
         {
             TotalScore[item.Key] = 0;
         }
         TotalScore[item.Key] += CurrentRoundScore[item.Key];
     }
 }
Ejemplo n.º 10
0
    // Update is called once per frame
    void Update()
    {
        if (Game.GameOver && !scoreUpdated)
        {
            int TotalScore;
            TotalScore = int.Parse(Player.Player_total_score) + Game.Score;
            Player.Player_total_score = TotalScore.ToString();


            scoreUpdated = true;
            // LevelScoreUpdate();
            UpdateScore();
        }
    }
Ejemplo n.º 11
0
 private void GetWinner()
 {
     if (TotalScore.All(x => x.HasValue))
     {
         for (int i = 0; i < Players.Length; i++)
         {
             if (TotalScore[i].Value == TotalScore.Max())
             {
                 GameWinner = Players[i];
                 break;
             }
         }
     }
 }
Ejemplo n.º 12
0
        public ScoringView()
        {
            InitializeComponent();
            NavigationPage.SetHasNavigationBar(this, false);

            GamesPlayed.BindingContext = PlayerScoreHistory.Instance();
            GamesPlayed.SetBinding(Label.TextProperty, new Binding("RoundsPlayed", BindingMode.OneWay, new StringToIntConverter()));

            WordsSolved.BindingContext = PlayerScoreHistory.Instance();
            WordsSolved.SetBinding(Label.TextProperty, new Binding("WordsSolved", BindingMode.OneWay, new StringToIntConverter()));

            TotalScore.BindingContext = PlayerScoreHistory.Instance();
            TotalScore.SetBinding(Label.TextProperty, new Binding("TotalScore", BindingMode.OneWay, new StringToIntConverter()));
        }
Ejemplo n.º 13
0
        public void AddClearedLines(int clearedLines)
        {
            TotalClearedLines += clearedLines;

            Level           = Mathf.FloorToInt(TotalClearedLines / (float)ClearedLinesPerLevel) + _startLevel;
            GravityInterval = _startGravityInterval / (Level + 1);

            int score = (BaseScore * clearedLines) * (Level + 1);

            TotalScore += score;

            _levelText.text        = Level.ToString();
            _clearedLinesText.text = TotalClearedLines.ToString();
            _totalScore.text       = TotalScore.ToString();
        }
Ejemplo n.º 14
0
 // Use this for initialization
 void Start()
 {
     player     = FindObjectOfType <Player>();
     totalScore = FindObjectOfType <TotalScore>();
     filmLeft   = filmSeconds;
     //go ahead and make some dots ahead of time.
     camDots = new GameObject[MAXDOTS];
     for (int i = 0; i < MAXDOTS; i++)
     {
         camDots[i] = GameObject.Instantiate(camDotPrefab);
         camDots[i].SetActive(false);
     }
     videoScore.gameObject.SetActive(false);
     body = GetComponent <Rigidbody2D>();
 }
Ejemplo n.º 15
0
        public override void Draw(Microsoft.Xna.Framework.GameTime gameTime, Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch)
        {
            Game.GraphicsDevice.Clear(Color.Black);

            spriteBatch.DrawString(_font, "Round: " + Round, new Vector2(700, 50), Color.White);

            int top = 200;

            //killed
            DrawText(_sKilled, _killed, top, spriteBatch);

            top += Y_MARGIN;

            //highest overall stress
            DrawText(_sHighestStress, _highestStress, top, spriteBatch);

            top += Y_MARGIN;

            //highest inflicted stress
            DrawText(_sHighestInflictedStress, _highestInflictedStress, top, spriteBatch);

            top += Y_MARGIN;

            //total inflicted stress
            DrawText(_sTotalStressInflicted, _totalInflictedStress, top, spriteBatch);

            top += Y_MARGIN;

            //remaining time
            DrawText(_sTimeLeft, _timeLeft, top, spriteBatch);

            top += Y_MARGIN;
            top += Y_MARGIN;
            top += Y_MARGIN;
            top += Y_MARGIN;

            //round score
            spriteBatch.DrawString(_font, _sRoundScore, new Vector2(_rightPos - _font.MeasureString(_sRoundScore).X, top), Color.White);
            spriteBatch.DrawString(_font, _roundScore, new Vector2(_rightPos + X_MARGIN, top), Color.Yellow);

            top += Y_MARGIN;

            spriteBatch.DrawString(_font, _sTotalScore, new Vector2(_rightPos - _font.MeasureString(_sTotalScore).X, top), Color.White);
            spriteBatch.DrawString(_font, TotalScore.ToString(), new Vector2(_rightPos + X_MARGIN, top), Color.Yellow);

            //Continue Text...
            spriteBatch.DrawString(_font, _sContinue, new Vector2(_rightPos - _font.MeasureString(_sContinue).X + _font.MeasureString(_roundScore).X + X_MARGIN, 650), Color.White);
        }
Ejemplo n.º 16
0
        private void btnAdd_Click(object sender, RoutedEventArgs e)
        {
            int score = Convert.ToInt32(txtScoreIn.Text);

            ScoreCount++;
            TotalScore += score;

            txtScoreCount.Text = ScoreCount.ToString();
            txtScoreTotal.Text = TotalScore.ToString();
            double average = (double)TotalScore / ScoreCount;

            txtScoreAverage.Text = average.ToString("0.00");

            txtScoreIn.Text = "";
            txtScoreIn.Focus();
        }
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (TeamId != null ? TeamId.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Location != null ? Location.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Category != null ? Category.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (int)Division;
         hashCode = (hashCode * 397) ^ (Tier != null ? Tier.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ ImageCount;
         hashCode = (hashCode * 397) ^ PlayTime.GetHashCode();
         hashCode = (hashCode * 397) ^ TotalScore.GetHashCode();
         hashCode = (hashCode * 397) ^ (int)Warnings;
         hashCode = (hashCode * 397) ^ (Advancement != null ? Advancement.GetHashCode() : 0);
         return(hashCode);
     }
 }
Ejemplo n.º 18
0
        private void PopulateList()
        {
            _thisGrid !.Children.Clear();
            _thisGrid.RowDefinitions.Clear();
            TextBlock thisLabel;

            if (_scoreList !.Count == 0)
            {
                thisLabel            = GetDefaultLabel();
                thisLabel.Text       = "No Scores";
                thisLabel.FontSize   = 30;
                thisLabel.FontWeight = FontWeights.Bold;
                AddControlToGrid(_thisGrid, thisLabel, 0, 0);
                return;
            }
            int x = 0;

            AddAutoRows(_thisGrid, _scoreList.Count + 2);
            thisLabel            = GetDefaultLabel();
            thisLabel.Text       = "Score Description";
            thisLabel.FontWeight = FontWeights.Bold;
            AddControlToGrid(_thisGrid, thisLabel, x, 0);
            thisLabel            = GetDefaultLabel();
            thisLabel.Text       = "Score";
            thisLabel.FontWeight = FontWeights.Bold;
            AddControlToGrid(_thisGrid, thisLabel, x, 1);
            x++;
            _scoreList.ForEach(thisScore =>
            {
                thisLabel      = GetDefaultLabel();
                thisLabel.Text = thisScore.Description;
                AddControlToGrid(_thisGrid, thisLabel, x, 0);
                thisLabel      = GetDefaultLabel();
                thisLabel.Text = thisScore.Score.ToString();
                AddControlToGrid(_thisGrid, thisLabel, x, 1);
                x++;
            });
            thisLabel            = GetDefaultLabel();
            thisLabel.FontWeight = FontWeights.Bold;
            thisLabel.Text       = "Total Score";
            AddControlToGrid(_thisGrid, thisLabel, x, 0);
            thisLabel            = GetDefaultLabel(); //at least for this.
            thisLabel.FontWeight = FontWeights.Bold;
            thisLabel.Text       = _model !.TotalScore.ToString();
            AddControlToGrid(_thisGrid, thisLabel, x, 1);
        }
Ejemplo n.º 19
0
        /// <summary>
        /// Serialize the current instance and write the result into a specified XML writer.
        /// </summary>
        /// <param name="writer">The XML writer into which to write the serialized instance.</param>
        /// <param name="gameType">The type of game the player participates in. This will be used to determine
        /// whether score card information needs to be serialized.</param>
        public void Serialize(XmlWriter writer, GameTypes gameType)
        {
            // Write start element
            writer.WriteStartElement("PlayerInformation");
            writer.WriteAttributeString("Name", Name);
            writer.WriteAttributeString("ID", PlayerID.ToString());
            writer.WriteAttributeString("Score", TotalScore.ToString());

            if (gameType == GameTypes.Offline)
            {
                // Write score card information
                writer.WriteBase64(ScoreCard, 0, ScoreCard.Length);
            }

            // Write end element
            writer.WriteFullEndElement();
        }
Ejemplo n.º 20
0
        public async Task <IHttpActionResult> GetStudentClassTotalScore(string id)
        {
            var student = db.Students.Where(x => x.id == id);

            if (student == null || student.Count() == 0)
            {
                Error notfound_error = new Error();
                notfound_error.error = "student-not-found";
                return(Ok(notfound_error));
            }
            else
            {
                int        total_score = student.Sum(x => x.score);
                TotalScore ts          = new TotalScore();
                ts.total = total_score;
                return(Ok(ts));
            }
        }
Ejemplo n.º 21
0
    private void Awake()
    {
        #region References

        buttonScoreText           = GameObject.Find("ButtonScore").GetComponent <Text>();
        startPositionOfButtonText = buttonScoreText.transform.position;

        gameManager = FindObjectOfType <GameManager>();

        sbangButton = FindObjectOfType <RemoveCard>();

        currentScoreText = FindObjectOfType <CurrentScore>();
        multiplierText   = FindObjectOfType <Multiplier>();
        timeBarText      = FindObjectOfType <TimeBar>();

        totalScoreText = FindObjectOfType <TotalScore>();

        #endregion
    }
Ejemplo n.º 22
0
        protected void TotalScoreCalc()
        {
            TotalScore = aces +
                         twos +
                         threes +
                         fours +
                         fives +
                         sixs +
                         ThreeofKind +
                         FourofKind +
                         FullHouse +
                         SmallStraight +
                         LargeStraight +
                         YahtzeeBonus +
                         Chance +
                         UpperBonus +
                         Yahtzee;

            totalScore.Text = TotalScore.ToString();
        }
Ejemplo n.º 23
0
        private void NewGameButton_Click(object sender, EventArgs e)
        {
            if (Player1ComboBox.Text != string.Empty)
            {
                SoundPlayer.PlayStartGameSound();
                AddPlayersToGame();

                var totalScore = new TotalScore(players);
                this.scoreStorage = new PlayersScoreStorage();
                Shuffle();
                InitPlayerScores();
                InitAvatars();
                ruler.StartGame(queue, totalScore, scoreStorage);
                BlockSettings();
                BackToMain();

                baseForm.Player1Avatar.FlatAppearance.BorderColor = Color.DarkOrange;
                baseForm.Player1Avatar.FlatAppearance.BorderSize  = 4;
            }
        }
Ejemplo n.º 24
0
    public static List <TotalScore> GetTotalScoreFromDatabase()
    {
        using (SqlConnection connection = new SqlConnection(connectionStringWriter)) {
            string sqlGetTotalScore =
                "SELECT TS.TotalScoreId, TS.TotalScore, TS.EmailId, E.EmailString " +
                "FROM TotalScore as TS " +
                "LEFT JOIN Email as E on E.EmailId = TS.EmailId";

            connection.Open();

            SqlDataReader     reader         = new SqlCommand(sqlGetTotalScore, connection).ExecuteReader();
            List <TotalScore> totalScoreList = new List <TotalScore>();

            if (reader == null)
            {
                Debug.LogError("No reader found");
                return(totalScoreList);
            }

            if (!reader.HasRows)
            {
                Debug.LogWarning("No rows found");
                return(totalScoreList);
            }

            while (reader.Read())
            {
                TotalScore TotalScore = new TotalScore {
                    Id            = Convert.ToInt32(reader["TotalScoreId"]),
                    CombinedScore = Convert.ToInt32(reader["TotalScore"]),
                    Email         = new Email {
                        Id          = Convert.ToInt32(reader["EmailId"]),
                        EmailString = reader["EmailString"].ToString()
                    }
                };
                totalScoreList.Add(TotalScore);
            }
            return(totalScoreList);
        }
    }
Ejemplo n.º 25
0
    // Use to process your families.
    protected override void onProcess(int familiesUpdateCount)
    {
        GameObject nextLvl = dest.First();
        TotalScore ts      = FamilyManager.getFamily(new AllOfComponents(typeof(TotalScore))).First().GetComponent <TotalScore>();

        foreach (GameObject go in structures)
        {
            Destroyed d = go.GetComponent <Destroyed> ();
            if (d.destroyed == false && d.transform.position.y < nextLvl.GetComponent <DestroyedStruct> ().destroyed_treshold)
            {
                d.destroyed = true;
                nextLvl.GetComponent <DestroyedStruct> ().nb_destroyed_struct++;
            }
        }

        if (FamilyManager.getFamily(new AllOfComponents(typeof(Collect))).Count == 0)
        {
            //NIVEAU TERMINE : affichage d'un message
            if (nextLvl.GetComponent <DestroyedStruct> ().nb_destroyed_struct > 0)
            {
                nextLvl.GetComponent <DestroyedStruct> ().ended_lvl = true;
                nextLvl.AddComponent <ChangeLevelAndNotDestroyed> ();
            }
            if (nextLvl.GetComponent <DestroyedStruct> ().ended_lvl == false)
            {
                ts.score_total += 50;
                // bonus si on a effectué le nombre de tir minimum
                // 100 - (différence entre min et nb tir)*20 ;
                int score = 100 - (Mathf.Abs(nextLvl.GetComponent <DestroyedStruct> ().nb_shoot - nextLvl.GetComponent <DestroyedStruct> ().nb_min_shoot)) * 20;
                score           = (score < 0) ? 0 : score;
                ts.score_total += score;
                nextLvl.GetComponent <DestroyedStruct> ().ended_lvl = true;
                GameObject winText = GameObject.FindGameObjectWithTag("win");
                winText.GetComponent <Canvas>().sortingOrder = 2;
                nextLvl.AddComponent <ChangeLevelAndNotDestroyed> ();
            }
        }
    }
Ejemplo n.º 26
0
    void Update()
    {
        _Score.text      = "Strokes: " + Score.ToString();
        _TotalScore.text = "Total Strokes: " + TotalScore.ToString();

        Distance = (DiscEmpty.transform.position - BasketTarget[holeNumber].transform.position).magnitude;

        _Distance.text = "Distance: " + Mathf.CeilToInt(Distance * 3.28f).ToString() + "\"";

        if (hasRung == true)
        {
            TotalScore += Score;
            Score       = 0;

            hasRung = false;

            holeNumber++;

            ResetSliders.resetRot = true;

            Throw.stopPowerBuilder = false;

            if (holeNumber > teeBox.Length - 1)
            {
                holeNumber = 0;
                DiscEmpty.transform.position = teeBox[0].transform.position;
                DiscEmpty.transform.LookAt(lookDownTeePad[0]);
                Throw.hasThrown = false;
            }
            else
            {
                DiscEmpty.transform.position = teeBox[holeNumber].transform.position;
                DiscEmpty.transform.LookAt(lookDownTeePad[holeNumber]);
            }
        }
    }
Ejemplo n.º 27
0
 // Use this for initialization
 void Start()
 {
     player = FindObjectOfType<Player>();
     totalScore = FindObjectOfType<TotalScore>();
     filmLeft = filmSeconds;
     //go ahead and make some dots ahead of time.
     camDots = new GameObject[MAXDOTS];
     for (int i = 0; i < MAXDOTS; i++)
     {
         camDots[i] = GameObject.Instantiate(camDotPrefab);
         camDots[i].SetActive(false);
     }
     videoScore.gameObject.SetActive(false);
     body = GetComponent<Rigidbody2D>();
 }
Ejemplo n.º 28
0
 // Use this for initialization
 void Start()
 {
     score = FindObjectOfType<TotalScore>();
 }
Ejemplo n.º 29
0
    void Start()
    {
        prota = GameObject.Find("Prota_01");
        prota.AddComponent <PlayerCtrl>();
        prota.AddComponent <PlayerAnimKitchen>();
        protaCube = GameObject.Find("platoEmpty");
        protaCube.AddComponent <PlatoCollider>();

        colliders = Instantiate(colliders, Vector3.zero, Quaternion.identity);

        aL_player = prota.AddComponent <AudioListener>();

        aM = GameObject.Find("AudioManager").GetComponent <AudioManager>();
        aM.Play(1, 2f);

        dialogs = GameObject.Find("Dialogs");
        if (dialogs == null)
        {
            Debug.LogError("404: dialogs_ini in Kitchen");
        }

        dial = dialogs.GetComponent <GestorDeDialogos>();

        setting = GameObject.Find("Main").GetComponent <Settings>();
        if (setting == null)
        {
            Debug.LogError("404: settings in Kitchen");
        }

        crono = GameObject.Find("Crono").GetComponent <Crono>();
        if (crono == null)
        {
            Debug.LogError("404: crono in Kitchen");
        }

        score_UI = GameObject.Find("Score").GetComponent <ScoreUI>();
        if (score_UI == null)
        {
            Debug.LogError("404: scoreUI in Kitchen");
        }

        controles = GameObject.Find("Controls").GetComponent <Canvas>();
        if (controles == null)
        {
            Debug.LogError("404: controls in Kitchen");
        }

        rico = GameObject.Find("rico").GetComponent <Rico>();
        if (rico == null)
        {
            Debug.LogError("404: rico in Kitchen");
        }

        tScore = GameObject.Find("TotalScore").GetComponent <TotalScore>();
        if (tScore == null)
        {
            Debug.LogError("404: tScore in Kitchen");
        }
        tScore.gameObject.SetActive(false);

        score = score_UI._scoreUI;
        score = 0;
        dialogs.SetActive(true);
        controles.renderMode = RenderMode.WorldSpace;

        prota.transform.position = new Vector3(0.18f, 0.0289f, -1.733f);
        prota.transform.rotation = Quaternion.Euler(new Vector3(0f, 180f, 0f));
    }
Ejemplo n.º 30
0
    //场景2的运算,0代表欺骗,1代表合作
    public void Solve2(int act)
    {
        switch (RoundNum)
        {
        case 1:
            Debug.Log("in case1");
            JudgeResult(act, PlayerBlue());
            break;

        case 2:
            Debug.Log("in case2");
            JudgeResult(act, PlayerPurple());
            break;

        case 3:
            Debug.Log("in case3");
            JudgeResult(act, PlayerPink());
            break;

        case 4:
            Debug.Log("in case4");
            JudgeResult(act, PlayerYellow());
            break;

        case 5:
            Debug.Log("in case5");
            JudgeResult(act, PlayerOrange());
            break;

        default:
            Debug.Log("none");
            break;
        }

        if (RoundNum == 5 && ClickNum == 5)
        {
            //进入下一场景
            OnRender(Scene2, 2);
            TextFinalScore.text = TotalScore.ToString();
        }
        else if (ClickNum == 5)
        {
            ClickNum       = 0;
            RoundNum      += 1;
            TotalScore    += ScorePerRound1;
            ScorePerRound1 = ScorePerRound2 = 0;
            switch (RoundNum)
            {
            case 2:
                sp             = Resources.Load("Images/ui/PlayerPurple", typeof(Sprite)) as Sprite;
                Player2.sprite = sp;
                break;

            case 3:
                sp             = Resources.Load("Images/ui/PlayerPink", typeof(Sprite)) as Sprite;
                Player2.sprite = sp;
                break;

            case 4:
                sp             = Resources.Load("Images/ui/PlayerYellow", typeof(Sprite)) as Sprite;
                Player2.sprite = sp;
                break;

            case 5:
                sp             = Resources.Load("Images/ui/PlayerOrange", typeof(Sprite)) as Sprite;
                Player2.sprite = sp;
                break;

            default:
                Debug.Log("none");
                break;
            }
            ShowScore();

            //这里应当放一段动画,要不最后一次显示不出来
            //System.Threading.Thread.Sleep(1000);这样不行
        }
    }
Ejemplo n.º 31
0
        private void Train_Button_Click(object sender, EventArgs e)
        {
            for (int i = 1; i <= FlexMainPoints_Updown.Value; i++)
            {
                switch (FlexMainIndex)
                {
                case 1:
                    Player_Possibilities.RopeSkipping = PossibilitiesAdd(Player_Possibilities.RopeSkipping);
                    break;

                case 2:
                    Player_Possibilities.PushUps = PossibilitiesAdd(Player_Possibilities.PushUps);
                    break;

                case 3:
                    Player_Possibilities.Basketball = PossibilitiesAdd(Player_Possibilities.Basketball);
                    break;

                case 4:
                    Player_Possibilities.Football = PossibilitiesAdd(Player_Possibilities.Football);
                    break;
                }
            }
            for (int i = 1; i <= FlexExtraPoints_Updown.Value; i++)
            {
                switch (FlexExtraIndex)
                {
                case 1:
                    Player_Possibilities.RopeSkipping = PossibilitiesAdd(Player_Possibilities.RopeSkipping);
                    break;

                case 2:
                    Player_Possibilities.PushUps = PossibilitiesAdd(Player_Possibilities.PushUps);
                    break;

                case 3:
                    Player_Possibilities.Basketball = PossibilitiesAdd(Player_Possibilities.Basketball);
                    break;

                case 4:
                    Player_Possibilities.Football = PossibilitiesAdd(Player_Possibilities.Football);
                    break;
                }
            }
            for (int i = 1; i <= PowerPoints_Updown.Value; i++)
            {
                switch (PowerIndex)
                {
                case 1:
                    Player_Possibilities.PullUps = PossibilitiesAdd(Player_Possibilities.PullUps);
                    break;

                case 2:
                    Player_Possibilities.SolidBall = PossibilitiesAdd(Player_Possibilities.SolidBall);
                    break;
                }
            }
            for (int i = 1; i <= SpeedPoints_Updown.Value; i++)
            {
                switch (SpeedIndex)
                {
                case 1:
                    Player_Possibilities.Run1000m = PossibilitiesAdd(Player_Possibilities.Run1000m);
                    break;

                case 2:
                    Player_Possibilities.Run800m = PossibilitiesAdd(Player_Possibilities.Run800m);
                    break;

                case 3:
                    Player_Possibilities.Swim50m = PossibilitiesAdd(Player_Possibilities.Swim50m);
                    break;
                }
            }
            DaysAvailable--;
            SyncAllNums();
            if (DaysAvailable == 0)
            {
                examTime = new ExamTime();
                examTime.ShowDialog();
                if (TotalScore < 30)
                {
                    MessageBox.Show("混账东西,居然只考了" + TotalScore.ToString() + "分\n滚去签字!", "CP来了", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
                else
                {
                    MessageBox.Show("很好,你得了30分", "CP来了", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
                Application.Exit();
            }
        }
Ejemplo n.º 32
0
    // mise a jour du score
    public void updateScore()
    {
        TotalScore ts = GameObject.FindGameObjectWithTag("total").GetComponent <TotalScore> ();

        score.text = "Score :  " + ts.score_total;
    }