Esempio n. 1
0
        public object Summary()
        {
            var redTeam = new
            {
                Name         = RedTeam.GetNameOrDefault(),
                FirstPlayer  = RedTeam.FirstPlayer.Name,
                SecondPlayer = RedTeam.SecondPlayer != null ? RedTeam.SecondPlayer.Name : "",
                Color        = Table.SideOneColor.ToString()
            };

            var blueTeam = new
            {
                Name         = BlueTeam.GetNameOrDefault(),
                FirstPlayer  = BlueTeam.FirstPlayer.Name,
                SecondPlayer = BlueTeam.SecondPlayer != null ? BlueTeam.SecondPlayer.Name : "",
                Color        = Table.SideTwoColor.ToString()
            };

            return(new
            {
                Teams = new
                {
                    RedTeam = redTeam,
                    BlueTeam = blueTeam
                },
                Score = new
                {
                    RedGoals = Goals.Count(g => g.Side == TableSide.Red),
                    BlueGoals = Goals.Count(g => g.Side == TableSide.Blue)
                },
                VanityString = _tauntTexts[CurrentTaunt()]
            });
        }