using Core.Helpers; using SptCommon.Annotations; using Core.Models.Eft.Common.Tables; using Core.Models.Eft.Ragfair; using Core.Models.Utils; using Core.Utils; namespace Core.Services; [Injectable(InjectionType.Singleton)] public class RagfairOfferService( ISptLogger _logger, TimeUtil _timeUtil, DatabaseService _databaseService, RagfairOfferHelper _ragfairOfferHelper , RagfairOfferHolder _ragfairOfferHolder, LocalisationService _localisationService) { /// /// Get all offers /// /// List of RagfairOffer public List GetOffers() { throw new NotImplementedException(); } public RagfairOffer? GetOfferByOfferId(string offerId) { throw new NotImplementedException(); } public List GetOffersOfType(string templateId) { throw new NotImplementedException(); } public void AddOffer(RagfairOffer offer) { throw new NotImplementedException(); } public void AddOfferToExpired(RagfairOffer staleOffer) { throw new NotImplementedException(); } /// /// Get total count of current expired offers /// /// Number of expired offers public int GetExpiredOfferCount() { Console.WriteLine($"actually implement me plz: owo: GetExpiredOfferCount"); return 0; } /// /// Get a list of lists of expired offer items + children /// /// Expired offer assorts public List> GetExpiredOfferAssorts() { Console.WriteLine($"actually implement me plz: owo: GetExpiredOfferAssorts"); return new List>(); } /// /// Clear out internal expiredOffers dictionary of all items /// public void ResetExpiredOffers() { Console.WriteLine($"actually implement me plz: owo: ResetExpiredOffers"); } /// /// Does the offer exist on the ragfair /// /// offer id to check for /// offer exists - true public bool DoesOfferExist(string offerId) { throw new NotImplementedException(); } /// /// Remove an offer from ragfair by offer id /// /// Offer id to remove public void RemoveOfferById(string offerId) { throw new NotImplementedException(); } /// /// Reduce size of an offer stack by specified amount /// /// Offer to adjust stack size of /// How much to deduct from offers stack size public void RemoveOfferStack(string offerId, int amount) { throw new NotImplementedException(); } public void RemoveAllOffersByTrader(string traderId) { throw new NotImplementedException(); } /// /// Do the trader offers on flea need to be refreshed /// /// Trader to check /// true if they do public bool TraderOffersNeedRefreshing(string traderId) { var trader = _databaseService.GetTrader(traderId); if (trader?.Base == null) { _logger.Error(_localisationService.GetText("ragfair-trader_missing_base_file", traderId)); return false; } // No value, occurs when first run, trader offers need to be added to flea trader.Base.RefreshTraderRagfairOffers ??= true; return trader.Base.RefreshTraderRagfairOffers.GetValueOrDefault(false); } public void AddPlayerOffers() { Console.WriteLine($"actually implement me plz: owo: AddPlayerOffers"); // throw new NotImplementedException(); } public void ExpireStaleOffers() { var time = _timeUtil.GetTimeStamp(); foreach (var staleOffer in _ragfairOfferHolder.GetStaleOffers(time)) { ProcessStaleOffer(staleOffer); } } /// /// Remove stale offer from flea /// /// Stale offer to process protected void ProcessStaleOffer(RagfairOffer staleOffer) { throw new NotImplementedException(); } protected void ReturnPlayerOffer(RagfairOffer playerOffer) { throw new NotImplementedException(); } /// /// Flea offer items are stacked up often beyond the StackMaxSize limit /// Unstack the items into a list of root items and their children /// Will create new items equal to the /// /// Offer items to unstack /// Unstacked list of items protected List UnstackOfferItems(List items) { throw new NotImplementedException(); } }