public SummaryStateView(SummaryState summaryState) { _score = new Sfg.Text($"Score: {summaryState.Score}", new Sfg.Font(FontFilePath), CharacterSize) { Position = new Vector2f(100, 100) }; }
public void setSummaryState(SummaryState _newState) { summaryState = _newState; }
private void drawSummary() { SummaryState state = (SummaryState)game.State; if (state.State == SummaryState.LocalState.DisplayWait) { TextSprite txt = getTextSprite( "STATUS SUMMARY #" + game.Round.ToString(), 22, Color.Yellow ); buffer.Blit( txt, new Point( game.Width / 2 - txt.Width / 2, SummaryState.SCREENBUFFER + SummaryState.VERTICALBUFFER / 2 - txt.Height / 2 )); txt = getTextSprite( "COLONY " + game.GetColonyTotal().ToString(), 22, Color.Yellow ); buffer.Blit( txt, new Point( game.Width / 2 - txt.Width / 2, game.Height - SummaryState.SCREENBUFFER - SummaryState.VERTICALBUFFER / 2 - txt.Height )); txt = getTextSprite( "PRESS ALL PLAYER BUTTONS TO GO ON.", 18, Color.White ); buffer.Blit( txt, new Point( game.Width / 2 - txt.Width / 2, game.Height - SummaryState.SCREENBUFFER - SummaryState.VERTICALBUFFER / 2 + 10 )); } Player[] players = game.OrderedPlayers; for (int i = 0; i < players.Length; i++) { drawPlayer( buffer, players[i].PlayerNum, state.Sprites[i].Frame, state.Sprites[i].X, state.Sprites[i].Y, state.Sprites[i].Small ); if (state.State == SummaryState.LocalState.DisplayWait) { for (int j = 0; j < 5; j++) { string text = string.Empty; switch (j) { case 0: text = players[i].Name; break; case 1: text = "MONEY"; break; case 2: text = "LAND"; break; case 3: text = "GOODS"; break; case 4: text = "TOTAL"; break; } TextSprite txt = getTextSprite( text, 18, ( state.PlayerReady[players[i].PlayerNum] && !players[i].AI ? Color.Yellow : getPlayerColor(players[i].Color) )); buffer.Blit( txt, new Point( state.Sprites[i].X + PLAYERWIDTH + 10, state.Sprites[i].Y + j * (txt.Height + 10) )); if (j > 0) { switch (j) { case 1: text = players[i].Money.ToString(); break; case 2: text = game.GetLandValue(players[i].PlayerNum).ToString(); break; case 3: text = game.GetGoodsValue(players[i].PlayerNum).ToString(); break; case 4: text = game.GetTotalValue(players[i].PlayerNum).ToString(); break; } txt = getTextSprite( text, 18, ( state.PlayerReady[players[i].PlayerNum] && !players[i].AI ? Color.Yellow : getPlayerColor(players[i].Color) )); buffer.Blit( txt, new Point( state.Sprites[i].X + (buffer.Width - SummaryState.SCREENBUFFER * 2) / 2 - 100 - txt.Width, state.Sprites[i].Y + j * (txt.Height + 10) )); } } } } }