/// <summary> /// Initialize the projectile event. /// </summary> /// <param name="timeline">The timeline this event is part of.</param> /// <param name="start">The start of the event.</param> /// <param name="dependentOn">An optional event to be dependent upon, ie. wait for.</param> /// <param name="position">The starting position of the projectile.</param> /// <param name="destination">The destination point of the projectile.</param> protected virtual void Initialize(Timeline timeline, float start, TimelineEvent dependentOn, Vector2 position, Destination destination) { //Call the base method. base.Initialize(timeline, start, dependentOn); //Initialize the variables. _Position = position; _Destination = destination; _Projectile = new FlameProjectile(_Position, _Destination); //Subscribe to the projectile's collision event. _Projectile.OnCollision += OnProjectileCollided; }
/// <summary> /// End this event when the projectile has collided with something. /// </summary> /// <param name="projectile">The projectile in question.</param> /// <param name="character">The character which the projectile collided with.</param> protected void OnProjectileCollided(Projectile projectile, Creature character) { //Conclude this event. EventConcludedInvoke(); }