public static PlayerInfo Create(Common.Player player, Common.Ball ball, TeamType team, IEnumerable<Common.Player> other) { Guard.NotNull(player, "player"); Guard.NotNull(ball, "ball"); var tackled = other.Where(o => player.CanTackle(o)).ToList(); if (tackled.Count > 0) { } var info = new PlayerInfo() { Id = PlayerMapping.GetId(player.PlayerType, team), Position = player.Position, Velocity = player.Velocity, IsBallOwner = player == ball.Owner, CanPickUpBall = player.CanPickUpBall(ball), CanBeTackled = tackled.Select(p => PlayerMapping.GetId(p.PlayerType, TeamType.Other)).ToList(), FallenTimer = player.FallenTimer, TackleTimer = player.TackleTimer, }; info.DistanceToOwnGoal = Goal.Own.GetDistance(info); info.DistanceToOtherGoal = Goal.Other.GetDistance(info); return info; }