Esempio n. 1
0
 //this sends the gameboard to each bar so they can update their counts/fill/button-enabledness
 public void UpdateFactionProgress(FactionProgress fp, CellStruct[,] playerState, CellStruct[,] enemyState)
 {
     foreach (ActionProgressBar bar in this.bars)
     {
         bar.UpdateBar(fp, playerState, enemyState);
     }
 }
Esempio n. 2
0
    public void UpdateBar(FactionProgress fp, CellStruct[,] playerState, CellStruct[,] enemyState)
    {
        int boardCount = GUtils.Serialize(playerState).Count(cell => cell.bldg == this.displayBldg && !cell.destroyed && !cell.defected);    //count all friendly spaces not taken over

        boardCount         += GUtils.Serialize(enemyState).Count(cell => cell.bldg == this.displayBldg && !cell.destroyed && cell.defected); //count all enemy spaces taken over
        this.countText.text = boardCount.ToString();
        //Fill the bar based on total progress
        int count = fp.GetProgress(this.faction);

        this.fill.fillAmount = (float)count / this.maxInterval;
    }
Esempio n. 3
0
 public void ActionSelectGroupUpdateFactionProgress(FactionProgress factionProgress, CellStruct[,] playerState, CellStruct[,] enemyState)
 {
     this.asg.UpdateFactionProgress(factionProgress, playerState, enemyState);
 }