示例#1
0
 public void OnDestinationReached(object sender, MapComponent.LocationEventArgs e)
 {
     if (e.Location == Company.Location)
     {
         CompanyReached?.Invoke(this, EventArgs.Empty);
     }
     if (e.Location == Locator.Market.Location)
     {
         MarketReached?.Invoke(this, EventArgs.Empty);
     }
 }
示例#2
0
        /// <summary>
        /// Callback for the <see cref = "TravelComponent.DestinationReached">DestinationReached</see> event.<br/>
        /// Invokes the <see cref = "CompanyReached">CompanyReached</see> or <see cref = "HomeReached">HomeReached</see> event.
        /// </summary>
        public void OnDestinationReached(object sender, MapComponent.LocationEventArgs e)
        {
            if (e.Location == Company.Location)
            {
                this.Log($"Employee reached company {Company}");
                CompanyReached?.Invoke(this, EventArgs.Empty);
            }

            if (e.Location == Home.Location)
            {
                this.Log($"Employee reached home {Home}");
                HomeReached?.Invoke(this, EventArgs.Empty);
            }
        }