public override CartComponent Create() { Component.Type = TypeObject.CartType; var exchangeFactory = new ExchangeFactory(TypeObject.Exchange.Value, GameObject); exchangeFactory.Create(); var travelFactory = new TravelFactory(TypeObject.Travel.Value, GameObject, ParentObject); var travelComponent = travelFactory.Create(); travelComponent.DestinationReached += Component.OnDestinationReached; return(Component); }
public override EmployeeComponent Create() { var travelFactory = new TravelFactory(TypeObject.Travel.Value, GameObject, ParentObject); var travelComponent = travelFactory.Create(); var personFactory = new PersonFactory(TypeObject.Person.Value, GameObject); personFactory.Create(); travelComponent.DestinationReached += Component.OnDestinationReached; if (Locator.Time) { Locator.Time.Morning += Component.OnMorning; Locator.Time.Evening += Component.OnEvening; } return(Component); }