Exemplo n.º 1
0
 public Team(TeamScheme scheme, ITeamStrategy strategy, List<Player> players)
 {
     TeamScheme = scheme;
     TeamStrategy = strategy;
     _players = players;
     SetDefaultPlayersPositions();
     SetPlayersStartPositions();
 }
Exemplo n.º 2
0
        public Team(Player[] players, ITeamStrategy strategy)
        {
            Contract.Requires<ArgumentNullException>(players != null);
            Contract.Requires<ArgumentNullException>(strategy != null);

            _players = players;
            _strategy = strategy;
        }
Exemplo n.º 3
0
 public void Update(ITeamStrategy strategy)
 {
     try
     {
         ChangePosition(strategy);
     }
     catch (Exception e)
     {
     }
 }
Exemplo n.º 4
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="Team" /> class with the specified strategy, players, and goal bounds.
        /// </summary>
        /// <param name="strategy">The team strategy.</param>
        /// <param name="players">The team players.</param>
        /// <param name="goalBounds">The bounds of the goal.</param>
        public Team(ITeamStrategy strategy, ReadOnlyCollection<PointMass> players, RectangleF goalBounds)
        {
            Contract.Requires<ArgumentNullException>(strategy != null);
            Contract.Requires<ArgumentNullException>(players != null);
            Contract.Requires<ArgumentException>(Contract.ForAll(players, p => p != null));
            Contract.Requires<ArgumentException>(goalBounds.Width > 0 && goalBounds.Height > 0);

            _strategy = strategy;
            Players = players;
            GoalBounds = goalBounds;
        }
 public void setStartegy(ITeamStrategy teamStrategy)
 {
     this._teamStrategy = teamStrategy;
     Console.WriteLine("Strategy Changing.......");
 }
Exemplo n.º 6
0
 public Team(ITeamStrategy T)
 {
     TeamStrategy = T;
 }
Exemplo n.º 7
0
 public void SetStrategy(ITeamStrategy strategy)
 {
     _strategy = strategy;
 }
Exemplo n.º 8
0
 //ContextInterface to set the strategy
 public void SetStrategy(ITeamStrategy s)
 { //Set the strategy
     strategy = s;
 }