Example #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Interpose"/> class.
 /// </summary>
 /// <param name="player">The player.</param>
 /// <param name="priority">The priority.</param>
 /// <param name="weight">The weight.</param>
 /// <param name="first">The first entity.</param>
 /// <param name="second">The second entity.</param>
 public Interpose(Player player, int priority, double weight,
                  MovableEntity first, MovableEntity second) : base(player, priority, weight)
 {
     First  = first;
     Second = second;
     Arrive = new Arrive(player, priority, weight, player.Position);
     PreferredDistanceFromSecond = Vector.GetDistanceBetween(Second.Position, First.Position) / 2.0;
 }
Example #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Interpose"/> class.
        /// </summary>
        /// <param name="player">The player.</param>
        /// <param name="priority">The priority.</param>
        /// <param name="weight">The weight.</param>
        /// <param name="first">The first entity.</param>
        /// <param name="secondPosition">The second position that is used instead of entity.
        /// The artificial second entity is created at this position.</param>
        public Interpose(Player player, int priority, double weight,
                         MovableEntity first, Vector secondPosition) : base(player, priority, weight)
        {
            First  = first;
            Second = new Ball(new FootballBall()) // artificial movable entity for representing second
            {
                Position = secondPosition
            };

            Arrive = new Arrive(player, priority, weight, player.Position);
            PreferredDistanceFromSecond = Vector.GetDistanceBetween(Second.Position, First.Position) / 2.0;
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="Pursuit"/> class.
 /// </summary>
 /// <param name="player">The player.</param>
 /// <param name="priority">The priority.</param>
 /// <param name="weight">The weight.</param>
 /// <param name="target">The target.</param>
 public Pursuit(Player player, int priority, double weight, MovableEntity target) :
     base(player, priority, weight)
 {
     Target       = target;
     TargetArrive = new Arrive(Player, priority, weight, target.Position);
 }