public static EndOfRound ReadEndOfRound(string line) { var match = EndOfRoundPattern.Match(line); if (!match.Success) { return(null); } var reader = new MatchReader(match); var time = ReadDate(reader); string triggeringTeam = reader.String(); string sfuiNotice = reader.String(); int counterTerroristScore = reader.Int(); int terroristScore = reader.Int(); var output = new EndOfRound { Time = time, TriggeringTeam = triggeringTeam, SfuiNotice = sfuiNotice, TerroristScore = terroristScore, CounterTerroristScore = counterTerroristScore, }; return(output); }
public static int?ReadMaxRounds(string line) { var match = MaxRoundsPattern.Match(line); if (!match.Success) { return(null); } var reader = new MatchReader(match); ReadDate(reader); int maxRounds = reader.Int(); return(maxRounds); }
static DateTime ReadDate(MatchReader reader) { int month = reader.Int(); int day = reader.Int(); int year = reader.Int(); int hour = reader.Int(); int minute = reader.Int(); int second = reader.Int(); var output = new DateTime(year, month, day, hour, minute, second); return(output); }
public static PlayerKill ReadPlayerKill(string line) { var match = KillPattern.Match(line); if (!match.Success) { return(null); } var reader = new MatchReader(match); var time = ReadDate(reader); string killerName = reader.String(); string killerSteamId = reader.String(); string killerTeam = reader.String(); int killerX = reader.Int(); int killerY = reader.Int(); int killerZ = reader.Int(); string victimName = reader.String(); string victimSteamId = reader.String(); string victimTeam = reader.String(); int victimX = reader.Int(); int victimY = reader.Int(); int victimZ = reader.Int(); string weapon = reader.String(); bool headshot = reader.String() != ""; var output = new PlayerKill { Time = time, Killer = new PlayerIdentity(killerName, killerSteamId), KillerTeam = killerTeam, KillerPosition = new Vector(killerX, killerY, killerZ), Victim = new PlayerIdentity(victimName, victimSteamId), VictimTeam = victimTeam, VictimPosition = new Vector(victimX, victimY, victimZ), Headshot = headshot, Weapon = weapon, }; return(output); }