public static bool IsWingBack(this Lineup.LineupRole role)
 {
     return(
         role == Lineup.LineupRole.WingBackLeft ||
         role == Lineup.LineupRole.WingBackRight ||
         role == Lineup.LineupRole.WingBackLeft_ ||
         role == Lineup.LineupRole.WingBackRight_);
 }
 // TODO: behavior "extra forward"
 public static bool IsForward(this Lineup.LineupRole role)
 {
     return(
         role == Lineup.LineupRole.ForwardLeft ||
         role == Lineup.LineupRole.ForwardMiddle ||
         role == Lineup.LineupRole.ForwardRight ||
         role == Lineup.LineupRole.Forward1_ ||
         role == Lineup.LineupRole.Forward2_);
 }
 // TODO: behavior "extra defender"
 public static bool IsCentralDefender(this Lineup.LineupRole role)
 {
     return(
         role == Lineup.LineupRole.CentralDefenderLeft ||
         role == Lineup.LineupRole.CentralDefenderMiddle ||
         role == Lineup.LineupRole.CentralDefenderRight ||
         role == Lineup.LineupRole.CentralDefender1_ ||
         role == Lineup.LineupRole.CentralDefender2_);
 }
 // TODO: behavior "extra inner midfielder"
 public static bool IsInnerMidfielder(this Lineup.LineupRole role)
 {
     return(
         role == Lineup.LineupRole.InnerMidfieldLeft ||
         role == Lineup.LineupRole.InnerMidfieldMiddle ||
         role == Lineup.LineupRole.InnerMidfieldRight ||
         role == Lineup.LineupRole.InnerMidfield1_ ||
         role == Lineup.LineupRole.InnerMidfield2_);
 }
 public static bool IsUnknownPosition(this Lineup.LineupRole role)
 {
     return(
         role == Lineup.LineupRole.InjuredWithoutReplacement ||
         role == Lineup.LineupRole.RedCardedPlayer ||
         role == Lineup.LineupRole.ReplacedPlayer1 ||
         role == Lineup.LineupRole.ReplacedPlayer2 ||
         role == Lineup.LineupRole.ReplacedPlayer3 ||
         role == Lineup.LineupRole.ReplacedPlayerN);
 }
示例#6
0
        public MatchAppearance(Player player, Team teamOfPlayer, MatchDetails match, Lineup.LineupRole role, double?ratingStars = null)
        {
            if (player == null || teamOfPlayer == null || match == null)
            {
                throw new ArgumentNullException("player, team or match");
            }

            Player       = player;
            TeamOfPlayer = teamOfPlayer;
            Match        = match;
            Role         = role;
            RatingStars  = ratingStars;
            Goals        = new List <Goal>();
        }
 public static bool IsActive(this Lineup.LineupRole role)
 {
     return(!(
                role == Lineup.LineupRole.Captain ||
                role == Lineup.LineupRole.SetPiecesTaker ||
                role == Lineup.LineupRole.SubstitutionKeeper ||
                role == Lineup.LineupRole.SubstitutionKeeper_ ||
                role == Lineup.LineupRole.SubstitutionDefender ||
                role == Lineup.LineupRole.SubstitutionDefender_ ||
                role == Lineup.LineupRole.SubstitutionInnerMidfield ||
                role == Lineup.LineupRole.SubstitutionInnerMidfield_ ||
                role == Lineup.LineupRole.SubstitutionWinger ||
                role == Lineup.LineupRole.SubstitutionWinger_ ||
                role == Lineup.LineupRole.SubstitutionForward ||
                role == Lineup.LineupRole.SubstitutionForward_));
 }
        private static void AddPlayer(IDictionary <Player, MatchAppearance> ret, int playerId, Team playerTeam, Lineup.LineupRole role, MatchDetails md, uint?redcarded, uint?substitutedIn, uint?substitutedOut)
        {
            if (playerId == 0)
            {
                return;                // ignore neighbourhood players
            }
            Player player = new Player(playerId, Player.UnknownName);

            if (!ret.ContainsKey(player))
            {
                ret.Add(player, new MatchAppearance(player, playerTeam, md, role));
            }

            if (substitutedIn != null)
            {
                ret[player].SubstituteIn = substitutedIn;
            }
            if (substitutedOut != null)
            {
                ret[player].SubstituteOut = substitutedOut;
            }
            if (redcarded != null)
            {
                ret[player].RedCarded = redcarded;
            }
        }
 public static bool IsKeeper(this Lineup.LineupRole role)
 {
     return(
         role == Lineup.LineupRole.Keeper ||
         role == Lineup.LineupRole.Keeper_);
 }