ToString Overrides for Gamestates

This commit is contained in:
glax 2024-01-15 20:39:38 +01:00
parent 7ad7c80697
commit b4b6f1dbb5
6 changed files with 56 additions and 0 deletions

View File

@ -5,4 +5,12 @@ public struct CS2GameState
public int Timestamp;
public Map? Map;
public Player? Player;
public override string ToString()
{
return $"{GetType()}\n" +
$"\tTime: {Timestamp}\n" +
$"\t{Map}\n" +
$"\t{Player}\n";
}
}

View File

@ -5,4 +5,13 @@ public struct Map
public string Mode, Name, Phase;
public int Round, NumMatchesToWinSeries;
public Team TeamCT, TeamT;
public override string ToString()
{
return $"{GetType()}\n" +
$"\t{Mode} {Name} {Round} Matches to Win Series: {NumMatchesToWinSeries}\n" +
$"\t{Phase}\n" +
$"\t{TeamCT}\n" +
$"\t{TeamT}\n";
}
}

View File

@ -7,4 +7,12 @@ public struct Player
public int? ObserverSlot;
public PlayerState? State;
public PlayerMatchStats? MatchStats;
public override string ToString()
{
return $"{GetType()}\n" +
$"\t{Name} {SteamId} {Activity} {Team}\n" +
$"\t{State}\n" +
$"\t{MatchStats}\n";
}
}

View File

@ -3,4 +3,12 @@
public struct PlayerMatchStats
{
public int Kills, Assists, Deaths, MVPs, Score;
public override string ToString()
{
return $"{GetType()}\n" +
$"\tKAD: {Kills} {Assists} {Deaths}\n" +
$"\tMVPs: {MVPs}\n" +
$"\tScore: {Score}\n";
}
}

View File

@ -4,4 +4,18 @@ public struct PlayerState
{
public int Health, Armor, Flashed, Smoked, Burning, Money, RoundKills, RoundHs, EquipmentValue;
public bool Helmet;
public override string ToString()
{
return $"{GetType()}\n" +
$"\tHealth: {Health}\n" +
$"\tArmor: {Armor}\n" +
$"\tFlashed: {Flashed}\n" +
$"\tSmoked: {Smoked}\n" +
$"\tBurning: {Burning}\n" +
$"\tMoney: {Money}\n" +
$"\tRoundKills: {RoundKills}\n" +
$"\tRoundHs: {RoundHs}\n" +
$"\tEquipmentValue: {EquipmentValue}\n";
}
}

View File

@ -3,4 +3,13 @@
public struct Team
{
public int Score, ConsecutiveRoundLosses, TimeoutsRemaining, MatchesWonThisSeries;
public override string ToString()
{
return $"{GetType()}\n" +
$"\tScore: {Score}\n" +
$"\tConsecutiveRoundLosses: {ConsecutiveRoundLosses}\n" +
$"\tTimeoutsRemaining: {TimeoutsRemaining}\n" +
$"\tMatchesWonThisSeries: {MatchesWonThisSeries}\n";
}
}