public Task UpdateRatingScore(long ratingId, ScoreUpdate score)
        {
            if (score is null)
            {
                throw new ArgumentNullException(nameof(score));
            }

            return(UpdateRatingScore());

            async Task UpdateRatingScore()
            {
                var ratingFromDb = await _context
                                   .Ratings
                                   .Where(rating => rating.RatingId == ratingId)
                                   .Include(rating => rating.User)
                                   .Include(rating => rating.Movie)
                                   .FirstOrDefaultAsync();

                if (ratingFromDb == null)
                {
                    throw new EntityNotFoundException($"A rating having id '{ratingId}' could not be found");
                }

                ratingFromDb.Score = score.Score;
                await _context.SaveChangesAsync();
            }
        }
示例#2
0
    public void ReceiveMessage(Message message)
    {
        var payload = ScoreUpdate.Build(message.payload);

        leaderboard.UpdateScore(message.playerId, payload.score);
        ImageManager.PopUpScores(payload.score, payload.index);
    }
示例#3
0
 void Start()
 {
     scoreUpdate    = GameObject.FindGameObjectWithTag("GameController").GetComponent <ScoreUpdate>();
     upgradeManager = transform.parent.parent.parent.GetComponent <UpgradeManager>();
     //Getting UpgradeManager from 'weapon name Upgrades panel' lol parent.parent.parent
     SetLineColor();
 }
示例#4
0
    void Gen(float fst, float snd, float third, float fourth)
    {
        GameObject temp;

        for (int i = 0; i < 5; i++)
        {
            Vector3 pos = new Vector3(gameObject.transform.position.x + i, gameObject.transform.position.y, gameObject.transform.position.z);
            float   p   = Random.value;
            if (p <= fst)
            {
                temp = Instantiate(mon1, pos, Quaternion.identity);
            }
            else if (p < snd)
            {
                temp = Instantiate(mon2, pos, Quaternion.identity);
            }
            else if (p < third)
            {
                temp = Instantiate(mon3, pos, Quaternion.identity);
            }
            else if (p < fourth)
            {
                temp = Instantiate(mon4, pos, Quaternion.identity);
            }
            else
            {
                temp = Instantiate(mon5, pos, Quaternion.identity);
            }

            ScoreUpdate     sc = GameObject.Find("Score").GetComponent <ScoreUpdate>();
            MonsterMovement mm = temp.GetComponent <MonsterMovement>();
            mm.onDeath += sc.IncrementScore;
            mm.onDeath += ac.PlaySplash;
        }
    }
 void Start()
 {
     zvukFlapa = this.GetComponent<AudioSource> ();
     scoreManager = GameObject.Find ("Score").GetComponent<ScoreUpdate> ();
     playerRB=this.GetComponent<Rigidbody2D>();
     IsMoving = false;
 }
示例#6
0
    private void FireScoreEvent()
    {
        var scoreEvent = new ScoreUpdate {
            score = currentScore
        };

        scoreEvent.FireEvent();
    }
示例#7
0
        public void IsNotValidIfGivenOtherThanNonNegativeNumbers(string score)
        {
            ScoreUpdate su = new ScoreUpdate()
            {
                MatchId = 101, UpdatedScore = score
            };

            Assert.False(su.IsValid());
        }
示例#8
0
        private void HandleScoreUpdate(NetIncomingMessage im)
        {
            var message = new ScoreUpdate(im);

            if (message.Score != null)
            {
                this.ScoreBoard.Score = message.Score;
            }
        }
        public void IsNotValidIfScoreNotSet()
        {
            ScoreUpdate su = new ScoreUpdate()
            {
                UpdatedScore = null
            };

            Assert.False(su.IsValid());
        }
示例#10
0
 // Use this for initialization
 void Start()
 {
     scoreUpdate       = GameObject.Find("EventSystem").GetComponent <ScoreUpdate>();
     starScore         = GameObject.Find("EventSystem").GetComponent <DisplayStars>();
     playerObj         = GameObject.Find("PlayerSphere");
     currentLevelStats = GameObject.Find("UI").GetComponent <Levels>();
     playerController  = playerObj.GetComponent <PlayerController>();
     audioClipPlayer   = GameObject.Find("UI").GetComponent <PlayAudioClip>();
 }
示例#11
0
        public void IsNotValidIfScoreNotSet()
        {
            ScoreUpdate su = new ScoreUpdate()
            {
                MatchId = 101
            };

            Assert.False(su.IsValid());
        }
示例#12
0
        public void IsValidWhenGivenParsableNonNegativeNumbers(string score)
        {
            ScoreUpdate su = new ScoreUpdate()
            {
                MatchId = 101, UpdatedScore = score
            };

            Assert.True(su.IsValid());
        }
示例#13
0
        public void IsNotValidIfMatchIdNotSet()
        {
            ScoreUpdate su = new ScoreUpdate()
            {
                UpdatedScore = "1:1"
            };

            Assert.False(su.IsValid());
        }
示例#14
0
        public void IsNotValidIfGivenMoreThanOneColon(string score)
        {
            ScoreUpdate su = new ScoreUpdate()
            {
                MatchId = 101, UpdatedScore = score
            };

            Assert.False(su.IsValid());
        }
        public void DifficultyChangesTestScriptSimplePasses()
        {
            MoleBehaviour Mole  = mole.AddComponent <MoleBehaviour>();
            ScoreUpdate   Score = score.AddComponent <ScoreUpdate>();

            Score.increase(20000);
            Mole.UpdateDifficulty();
            Assert.AreEqual(speed, Mole.speed);
            Score.setScoreValue(0);
        }
示例#16
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(gameObject);
     }
 }
	void GameComplete()
	{
		if (isGameComplete)
		{
			textObj01.SetActive (true);
			textObj02.SetActive (true);
			textComponent01.text = "Complete!";
			textComponent02.text = "Please Any Button";
			//soundManager.PlaySE (4);
			this.scoreUpdate = this.InstanceManager.GetComponent<InstanceObject>().Nullmethod;
		}
	}
示例#18
0
    public static ScoreUpdate DeserializeScore(string code)
    {
        string[]    splitCode = code.Split(':');
        ScoreUpdate score     = new ScoreUpdate();

        score.ID             = int.Parse(splitCode[1]);
        score.CurrentStrokes = int.Parse(splitCode[2]);
        score.PersonalBest   = int.TryParse(splitCode[3], out int test)? (int?)test : null;
        score.Kills          = int.Parse(splitCode[4]);
        score.Deaths         = int.Parse(splitCode[5]);

        return(score);
    }
    void OnTriggerEnter2D(Collider2D col)
    {
        // CHECKS IF THE COLLISION IS WITH THE LEFT BOUND
        if (col.gameObject.tag == "Obstacles")
        {
            // SELECTS RANDOM Y COORDINATE TO RESET OBSTACLE TO
            float random = Random.Range(-32, 40);
            // RESETS POSITION OF OBSTACLE
            col.gameObject.transform.position = new Vector3(0f, random, 2f);
        }
        // MAKES THE OBSTACLE SCOREABLE AGAIN
        ScoreUpdate scoreUpdate = col.gameObject.GetComponentInChildren <ScoreUpdate>();

        scoreUpdate.resetScored();
    }
	void Start () 
	{
		this.scoreUpdate = () => { };
		isPlaying = false;
		isGameComplete = false;
		isGameOver = false;

		textObj01 = GameObject.Find (objName01);
		textObj02 = GameObject.Find (objName02);
		textComponent01 = textObj01.GetComponent<Text> ();
		textComponent02 = textObj02.GetComponent<Text> ();
		moveScene = FindObjectOfType<MoveScene> ();
		startCameraEvent = FindObjectOfType<StartCameraEvent> ();

		StartCoroutine (CountDown());
    }
示例#21
0
        public async Task <int> ScoreUpdate(ScoreUpdate su)
        {
            SSQCScoreUpdate spa = new SSQCScoreUpdate
            {
                GameID    = su.GameID,
                GameTime  = su.GameTime,
                TeamOne   = su.TeamOne,
                TeamTwo   = su.TeamTwo,
                TeamThree = su.TeamThree,
                TeamFour  = su.TeamFour
            };

            await _context.AddAsync(spa);

            return(await _context.SaveChangesAsync());
        }
示例#22
0
 private void Start()
 {
     su            = GameObject.FindObjectOfType <ScoreUpdate>();
     waveCountdown = timeFirstWave;
     m_chrono      = GameObject.FindGameObjectWithTag("WaveChrono").GetComponent <Chrono>();
     if (m_chrono == null)
     {
         Debug.LogError("Could not find any Chrono object with tag \"Chrono\" in script WaveSpawner.cs");
     }
     m_waveCounter = GameObject.FindGameObjectWithTag("WaveCounter").GetComponent <WaveCounter>();
     if (m_waveCounter == null)
     {
         Debug.LogError("Could not find any WaveCounter object with tag \"WaveCounter\" in script WaveSpawner.cs");
     }
     if (spawnPoints.Length == 0)
     {
         Debug.LogError("Pas de points de spawn");
     }
 }
示例#23
0
    void Start()
    {
        nbCorrect   = 0;
        nbWrong     = 0;
        scoreUpdate = scoreGameObj.GetComponent <ScoreUpdate>();
        if (gamemode == "calcul")
        {
            calculScript = calculGameObj.GetComponent <NewCalcul>();
            calculScript.randomCalcul();
            currentCalcul.text = calculScript.calculQuestion;
        }
        else if (gamemode == "table")
        {
            calculTableScript = calculGameObj.GetComponent <NewTableCalcul>();
            calculTableScript.randomCalcul();
            currentCalcul.text = calculTableScript.calculQuestion;
        }

        resultField.text = "";
        digitButtons     = calculDigits.GetComponentsInChildren <Button>();
    }
	IEnumerator CountDown()
	{
		textComponent01.text = "";
		startCameraEvent.second_Three ();
		yield return new WaitForSeconds (1);
		textComponent01.text = "3";
		yield return new WaitForSeconds (1);
		startCameraEvent.second_Two ();
		textComponent01.text = "2";
		yield return new WaitForSeconds (1);
		startCameraEvent.second_One ();
		textComponent01.text = "1";
		yield return new WaitForSeconds (1);
		startCameraEvent.second_Zero ();
		textComponent01.text = "START!";
		this.scoreUpdate = this.InstanceManager.GetComponent<InstanceObject>().OnUpdateScore;		// delegate

		isPlaying = true;
		yield return new WaitForSeconds (1.5f);
		textObj01.SetActive (false);
	}
示例#25
0
 public async Task <int> ScoreUpdate(ScoreUpdate su)
 {
     return(await _SSQCStatsRepository.ScoreUpdate(su));
 }
示例#26
0
 // Use this for initialization
 void Start()
 {
     scoreUpdate  = GameObject.Find("Canvas/ScoreText").GetComponent <ScoreUpdate>();
     scoreUpdate1 = GameObject.Find("Canvas/CurrentScoreText").GetComponent <CurrentScoreControl>();
 }
示例#27
0
 void Start()
 {
     //RandomizeLootName ();
     // = GetComponent<GameStateManager>().GetComponent<ScoreUpdate>();
     scoreUpdateObject = GameObject.FindGameObjectWithTag("GameController").GetComponent <ScoreUpdate>();
 }
示例#28
0
 public void TestTearDown()
 {
     score = null;
 }
示例#29
0
 public void TestSetup()
 {
     score = new ScoreUpdate();
     //ScoreUpdate Score = score.AddComponent<ScoreUpdate>();
 }
示例#30
0
        public async Task <IActionResult> UpdateScore([FromRoute] long ratingId, [FromBody] ScoreUpdate score)
        {
            await _ratingService.UpdateRatingScore(ratingId, score);

            return(NoContent());
        }
示例#31
0
        public async Task <int> ScoreUpdate([FromBody] ScoreUpdate su)
        {
            var resp = await _statsService.ScoreUpdate(su);

            return(resp);
        }
示例#32
0
    public void SaveScore()
    {
        TMP_InputField TMP = GameObject.FindObjectOfType <TMP_InputField>();

        ScoreData.addScore(ScoreUpdate.getScore(), "Pr." + TMP.text);
    }
示例#33
0
 private void Awake()
 {
     objectText  = GameObject.Find("Text");
     scoreUpdate = objectText.GetComponent <ScoreUpdate>();
 }
 void GameOver()
 {
     if (isGameOver)
     {
         textObj01.SetActive(true);
         textObj02.SetActive(true);
         textComponent01.text = "Miss!";
         textComponent02.text = "Please Any Button";
         this.scoreUpdate = this.InstanceManager.GetComponent<InstanceObject>().Nullmethod;
     }
 }
示例#35
0
 private void Updatescore()
 {
     ScoreUpdate?.Invoke(this, EventArgs.Empty);
 }