private void UpdateScoreboard(HUD hud, FieldInfo fieldInfo)
        {
            ScoreboardController scoreboardController = hud.scoreboardPanel.GetComponent <ScoreboardController>();

            if (scoreboardController != null)
            {
                UIElementAllocator <ScoreboardStrip> elements = (UIElementAllocator <ScoreboardStrip>) typeof(ScoreboardController)
                                                                .GetField("stripAllocator", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(scoreboardController);

                if (elements != null)
                {
                    List <ScoreboardStrip> scoreboardStrips = (List <ScoreboardStrip>) typeof(UIElementAllocator <ScoreboardStrip>)
                                                              .GetField("elementControllerComponentsList", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(elements);

                    foreach (ScoreboardStrip scoreboardStrip in scoreboardStrips)
                    {
                        if (scoreboardStrip == null)
                        {
                            continue;
                        }

                        if (fieldInfo != null)
                        {
                            List <ItemIcon> itemIcons = (List <ItemIcon>)fieldInfo.GetValue(scoreboardStrip.itemInventoryDisplay);

                            foreach (ItemIcon itemIcon in itemIcons)
                            {
                                if (itemIcon != null && itemIcon.GetComponent <DropItemController>() == null)
                                {
                                    DropItemController dropItemController = itemIcon.gameObject.AddComponent <DropItemController>();
                                    Inventory          inventory          = (Inventory)typeof(ItemInventoryDisplay).GetField("inventory", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(scoreboardStrip.itemInventoryDisplay);
                                    dropItemController.Inventory            = inventory;
                                    dropItemController.ItemIcon             = itemIcon;
                                    dropItemController.SendDropItemToServer = SendDropItemRequest;
                                }
                            }
                        }

                        EquipmentIcon equipmentIcon = scoreboardStrip.equipmentIcon;

                        if (equipmentIcon != null && equipmentIcon.GetComponent <DropItemController>() == null)
                        {
                            if (equipmentIcon.targetInventory == null)
                            {
                                continue;
                            }
                            EquipmentIndex equipmentIndex = (equipmentIcon.displayAlternateEquipment) ? equipmentIcon.targetInventory.alternateEquipmentIndex : equipmentIcon.targetInventory.currentEquipmentIndex;

                            if (equipmentIndex != EquipmentIndex.None)
                            {
                                DropItemController dropItemController = equipmentIcon.gameObject.AddComponent <DropItemController>();
                                dropItemController.Inventory                 = equipmentIcon.targetInventory;
                                dropItemController.EquipmentIcon             = equipmentIcon;
                                dropItemController.SendDropEquipmentToServer = SendDropEquipmentRequest;
                            }
                        }
                    }
                }
            }
        }
 // Called when level is completed, opens level complete screen
 public void CompletedLevel(int lev, ScoreboardController sc)
 {
     level = lev;
     scoreboardController = sc;
     levelBanner.sprite   = levelBannersArray[lev - 1];
     scoreboardController.processFinalScore(level);
     currentScore.text = scoreboardController.getNumMovesMade()
                         + "\n" + scoreboardController.getTotalTime();
     bestScore.text = "| " + scoreboardController.getBestNumMovesMade()
                      + "\n| " + scoreboardController.getBestTotalTime();
     drawStars(scoreboardController.getScore());
     // Update Farther Reached Level stat
     if (PlayerPrefs.GetInt("LevelPassed") < level)
     {
         PlayerPrefs.SetInt("LevelPassed", level);
     }
     // Disable other UI elements
     foreach (GameObject o in uiElementsArray)
     {
         if (o != null)
         {
             o.SetActive(false);
         }
     }
 }
        public void PuzzleGetSuccess()
        {
            var            controller     = new ScoreboardController(dynamoClient);
            var            result         = controller.Get();
            OkObjectResult okObjectResult = Assert.IsType <OkObjectResult>(result.Result);

            Assert.Equal(200, okObjectResult.StatusCode);
        }
Exemple #4
0
 public void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(gameObject);
         return;
     }
 }
 // Find reference of ScoreboardController and assign to _scoreboardController
 private void _GetScoreboardController()
 {
     GameObject scoreboardControllerObject = GameObject.FindGameObjectWithTag("ScoreboardController");
     if ( scoreboardControllerObject != null )
     {
         this._scoreboardController = scoreboardControllerObject.GetComponent<ScoreboardController>();
     }
     if ( scoreboardControllerObject == null )
     {
         Debug.Log("Cannot find 'ScoreboardController' script");
     }
 }
    // Find reference of ScoreboardController and assign to _scoreboardController
    private void _GetScoreboardController()
    {
        GameObject scoreboardControllerObject = GameObject.FindGameObjectWithTag("ScoreboardController");

        if (scoreboardControllerObject != null)
        {
            this._scoreboardController = scoreboardControllerObject.GetComponent <ScoreboardController>();
        }
        if (scoreboardControllerObject == null)
        {
            Debug.Log("Cannot find 'ScoreboardController' script");
        }
    }
    void Start()
    {
        StartCoroutine(SpawnWaves());

        // Find reference of ScoreboardController and assign to _scoreboardController
        GameObject scoreboardControllerObject = GameObject.FindGameObjectWithTag("ScoreboardController");
        if (scoreboardControllerObject != null)
        {
            _scoreboardController = scoreboardControllerObject.GetComponent<ScoreboardController>();
        }
        if (scoreboardControllerObject == null)
        {
            Debug.Log("Cannot find 'ScoreboardController' script");
        }
    }
        public void PuzzlePostSuccess()
        {
            var controller = new ScoreboardController(dynamoClient);
            var result     = controller.Post("ZZZ");

            ActionResult   testResult     = (ActionResult)result.Result;
            OkObjectResult okObjectResult = Assert.IsType <OkObjectResult>(testResult);

            Assert.Equal(200, okObjectResult.StatusCode);

            //Post Test Cleanup
            var postResults = dynamoClient.GetLeaderBoard().Result;
            var item        = postResults.FirstOrDefault(x => x.Initials == "ZZZ");
            var deletedItem = dynamoClient.DeleteLeaderBoardEntry(item.Id);
        }
Exemple #9
0
    private void Awake()
    {
        _moveableReferencer   = GetComponent <MoveableReferencer>();
        _timerTextController  = GetComponent <TimerTextController>();
        _scoreboardController = GetComponent <ScoreboardController>();
        _audioSource          = GetComponent <AudioSource>();
        _musicController      = GetComponentInChildren <MusicController>();

        TcpConfig tcpConfig = new TcpConfig(true, 5000, 45000);

        _webClient                 = SimpleWebClient.Create(16 * 1024, 1000, tcpConfig);
        _webClient.onConnect      += WebClientOnonConnect;
        _webClient.onData         += WebClientOnonData;
        _webClient.onDisconnect   += WebClientOnonDisconnect;
        Builder.ObjectMoved       += BuilderOnObjectMoved;
        Interacter.WrongGuessMade += InteracterOnWrongGuessMade;
    }
Exemple #10
0
    private void UpdateScoreboard()
    {
        Player[] rankings = ScoreboardController.getRankings();

        for (var i = 0; i < 10; i++)
        {
            Player p = rankings[i];

            if (p == null)
            {
                continue;
            }

            int position = 9 - i;

            names[position].text  = p.getName();
            kills[position].text  = "" + p.getKills();
            deaths[position].text = "" + p.getDeaths();
        }
    }
  // Called when level is completed, opens level complete screen
  public void CompletedLevel(int lev, ScoreboardController sc)
  {
      level = lev;
      scoreboardController = sc;
      levelBanner.sprite   = levelBannersArray[lev - 1];
      scoreboardController.processFinalScore(level);
      currentScore.text = scoreboardController.getNumMovesMade()
                          + "\n" + scoreboardController.getTotalTime();
      bestScore.text = "| " + scoreboardController.getBestNumMovesMade()
                       + "\n| " + scoreboardController.getBestTotalTime();
      scoreboardController.drawStars(scoreboardController.getScore(), starSpritesArray, starsArray);

      // Disable other UI elements
      foreach (GameObject o in uiElementsArray)
      {
          if (o != null)
          {
              o.SetActive(false);
          }
      }
  }
        private void Form1_Load(object sender, EventArgs e)
        {
            ScoreboardController scoreboard = new ScoreboardController();

            Controls.Add(scoreboard.getView());

            int aantalTeerlingen = 3;

            List<TeerlingController> teerlingen = new List<TeerlingController>();

            //doe alle teerlingen in een list
            for (int teerlingNr = 0; teerlingNr < aantalTeerlingen; ++teerlingNr)
            {
                TeerlingController newTeerling = new TeerlingController(scoreboard);
                teerlingen.Add(newTeerling);
            }

            //voeg teerlingen aan formulier
            for (int teerlingNr = 0; teerlingNr < aantalTeerlingen; ++teerlingNr)
            {

                TeerlingView thisView = teerlingen[teerlingNr].getView();
                int xPos = thisView.Width * teerlingNr;
                thisView.Location = new Point(xPos, 50);

                Controls.Add(thisView);

            }

            this.Width = aantalTeerlingen * teerlingen[1].getView().Width;

            WerpController werpCtrl = new WerpController();
            WerpView werpView = werpCtrl.getView();
            werpView.Location = new Point((this.Width / 2) - (werpView.Width / 2), 350);

            //load teerlingen in werper model
            werpCtrl.addTeerlingen(teerlingen);

            Controls.Add(werpView);
        }
    public override void OnEnterState(GameController gameController)
    {
        controller    = gameController.GetController();
        discRigidbody = gameController.GetDisc().GetComponent <Rigidbody>();
        gameController.SetScoreboardActive(true);
        ScoreboardController scoreboard = gameController.GetScoreboardController();
        int finalScore = scoreboard.GetFinalScore();
        int finalDiff  = scoreboard.GetFinalDifference();

        discRigidbody.isKinematic = true;

        string sceneName = SceneManager.GetActiveScene().name;
        string keyScore  = "bestScore_" + sceneName;
        string keyDiff   = "bestDiff_" + sceneName;
        int    bestScore = PlayerPrefs.GetInt(keyScore, -1);

        if (bestScore == -1 || finalScore < bestScore)
        {
            PlayerPrefs.SetInt(keyScore, finalScore);
            PlayerPrefs.SetInt(keyDiff, finalDiff);
        }
    }
Exemple #14
0
 void Start()
 {
     scoreboardController = GameObject.Find("ScoreboardController").GetComponent<ScoreboardController>();
     teamScoreboard = GameObject.Find("TeamScores").GetComponent<Text>();
 }
 public void AwayGoal()
 {
     AwayScore++;
     ScoreboardController.Goal();
 }
 public void HomeGoal()
 {
     HomeScore++;
     ScoreboardController.Goal();
 }
 public TeerlingView(TeerlingController teerlingCtrl, ScoreboardController scoreboardCtrl)
 {
     _controllerTeerling = teerlingCtrl;
     _controllerScore = scoreboardCtrl;
     InitializeComponent();
 }
    // Use this for initialization
    void Start()
    {
        instance = this;

        playerOneScore = playerTwoScore = 0;
    }
 void Start()
 {
     player1Score = player2Score = 0;
     instance     = this;
 }
 internal void RegisterScoreboard(ScoreboardController scoreBoard)
 {
     scoreboardController = scoreBoard;
 }
Exemple #21
0
 public void Release()
 {
     instance = null;
 }
Exemple #22
0
 void Start()
 {
     score = ScoreboardController.GetScore(player);
     gameObject.GetComponent <TMPro.TMP_Text>().text = score.ToString();
 }