# IdleKit Gameplay Change Logs

## Version 2.x 2022-xx-xx
* *FEATURE* `INonConsumableItem` has been added to represent a reward item that is non-consumable 
* *FEATURE* Introduced `PayoutAmount` struct in place of `CurrencyAmount` to represent both non-consumable items and currency items. See `UPGRADENOTES.md` for details.
* *CHANGE* `IStandardContentSavedData.TradeInputCurrencyAmount` and `IStandardContentSavedData.TradeOutputCurrencyAmount` is now renamed to `IStandardContentSavedData.TradeInputAmount` and `IStandardContentSavedData.TradeOutputAmount` due to the introduction of `PayoutAmount`
* *CHANGE* `ITrade.InputCurrencyAmount` and `ITrade.OutputCurrencyAmount` is now renamed to `ITrade.InputAmount` and `ITrade.OutputAmount` due to the introduction of `PayoutAmount`
* *CHANGE* `GrantPayoutStateAction` now pays non currency items inheriting the `INonConsumableItem` interface

## Version L.3.0 2021-07-26
* *FEATURE* Add `IConnectionStatusService` and the implement `NetworkConnectionStatusService` which dispatches a `NetworkStatusChangedAction`. These new systems are used for tracking IdleKit's connection to Beamable.
* *FEATURE* Localization Service has been implemented as `ILocalizationService`
* *FEATURE* Add `LeaderboardService` and the corresponsing inteface for updating leaderboards
* *FEATURE* `PurchasingService` has been implemented to handle IAP in IdleKit gamess
* *FEATURE* `StoreProductData` for storing a list of all purchasable items in the game
* *FEATURE* `PromoService` and corresponding `Promo` and `Trigger` entities added, for managing promotional offers in game
* *CHANGE* Added logging to the `Beamable` class to indicate which data abnormalities cause launch failures
* *FEATURE* `FilterPromoContentDataLoadPhase` added for controlling A/B testing for promos
* *FEATURE* Added `GachaOddsService` for calculating the odds of the rewards from within a `GachaReward`
* *FEATURE* `AvatarService` for retrieving new `AvatarCollection`s which are used to store information about in-game avatars. `UserSavedData` now has an `avatarId` field, which determines which avatar the player currently has equipped. 
* *FEATURE* `AvatarsUnlockReward` is a new type of reward that unlocks avatars when claimed. This reward is of the new reward type `ICustomPayoutReward` which allows creating of rewards that perform payout with their own custom methods. `GrantRewardStateAction` has been adjusted to support this new type.
* *CHANGE* The `TContract[] ResolveAll<TContract>(IEnumerable<object> ids)` method of the `Container` class now logs an error if one of the ids from the list wasn't found in the container. It also returns a list of all the rest of the items that were found instead of failing with an exception.

## Version L.2.1, 2021-04-29
*FEATURE* Update Beamable to 0.9

## Version L.2.0, 2021-04-07

### General
* *FEATURE* Beamable inventory implementation has been added, as now anything that is not an `EventSettingsSavedData`, `IUserSavedData`, or `SerializedDataCache` is saved and stored using the Beamable's inventory system. This paves the road for eventually controlling the player's inventory from the Beamable portal.

### Analytics
* *CHANGE* `IdleKit.Analytics` has become a required dependency of `IdleKit.Gameplay` as Analytics is now a required package within IdleKit.
* *FEATURE* Added 3 analytics tracking services to accomodate new analytics events: `ContentProgressionAnalyticsTrackingService`, `CurrencyChangeAnalyticsTrackingService`, `UserAcquisitionAnalyticsTrackingService`.

## Version L.1.0, 2021-02-10

### General
* *FEATURE* Beamable has been added as a framework which will manage IdleKit's remote data in the cloud, as well as provide simpler tools for data authoring to game designers. Beamble keeps data in a remote server in `realms`, which correspond to IdleKit projects. See the [Beamble Introductory Documentation](https://eastsidegames.atlassian.net/wiki/spaces/IDLEKIT/pages/979075147/Beamable) for more information.
* *CHANGE* Across the project, Entity Id naming has been changed from `InstanceId` to `Id`. This is because the sharing of data instances for Entities has be deprecated as part of Beamable integration.
* *FEATURE* Added a new `Beamable` class, which is reposible for wrapping Beamable's interactions with remote data such as retrieving data, and resetting User Data.
* *CHANGE* Removed unit tests related to testing shared identical data between contents as that is no longer supported.
* *CHANGE* Removed the unit test for Loading Saved Data when switching content.
* *CHANGE* Removed the unit test for Generating content specific Saved Id.

### AutoCollectState
* *CHANGE* `CollectMultiplier` has been removed since now this is a property of `IBaseCollectorEntity`
* *CHANGE* `CollectDuration` has been removed since its value is equal to `IBaseCollectorEntity.Duration`

### Data
* *CHANGE* `ScriptableObjectBaseData` has been replaced by 3 base classes:
  * `IKItemContent` is the underlying class for Beamable generic Static Data assets which have an `ISavedData` associated with them, and which can save data between sessions.
  * `IKContent` is the underlying class for Beamable generic Static Data assets which don't have an `ISavedData` associated with them, and don't need to save data between sessions.
  * `IKCurrencyContent` is the underlying class for Beamable Static Currency Data assets. This is a specified data base class for Currency objects, as defined by the Beamable framework.
* *CHANGE* `IKManifest` has been removed, with the introduction of the YAMLton sheet data pipeline, which is now the default way to get design data into a Beamble realm.
* *CHANGE* `IsContentSpecific` property has been removed from `ISavedDataProvider` as due to Beamble's requirement, all data is now global, with no Entity and Data instancing allowed.
* *FEATURE* Beamble brings a new attribute `ContentTypeAttribute`, which is used on IdleKit's Static Data Assets. This new attribute is a requirement to make IdleKit's data compatible with Beamable.

### IBaseCollectorEntity
* *FEATURE* `IBaseCollectorEntity` is now capable to work with duration under 1 ms by modifying its `PayoutAmount`
* *CHANGE* `CollectMultiplier` has been added as property. It multiplies the payout amount for duration under 1 ms.

### Economy Service
* *CHANGE* `IEconomyService` has been deprecated and the ascension power calculation has been moved to `IStage`.

### Editor
* *CHANGE* Changed the editor menu item functionality for `IdleKit/Tools/Reset User`, which now deletes the token for the current user data on Beamable, therefore deleting the current user's data. This replaces the previous method for resetting local data, as now IdleKit's User Data is kept in the Beamable's servers.

### Entities
* *CHANGE* Default constructors have been added to all Entities as required by Beamable.
* *CHANGE* A number of constructors for Entites have been changed to remove the ability to create Entities with shared static data, as required by the Beamable integration. See the `General` section of this document and our [UPGRADENOTES.md](https://github.com/Idlekit/idlekit-gameplay/blob/release-L.x/UPGRADENOTES.md) file for more details on new Entity instancing rules.

### Event Settings
* *FEATURE* Added support for using events created with the same `IEventSettingsData`. The events created from the same `IEventSettingsData` must NOT be run in parallel, as all the player's event related Saved Data will be erased when entering an event made from previously used static data.
* *FEATURE* `IEventSettings` and its implementation in `EventSettings` have both been adjusted to account for the new events data provided by Beamable. Events now consist of several phases, each with their own duration. The first phase is intended as an "announcement" phase during which the player cannot enter the event.
* *CHANGE* `IEventSettingsData` doesn't contain `UniqueContentId` as content instancing by Id has been deprecated. See the `General` section of this document and our [UPGRADENOTES.md](https://github.com/Idlekit/idlekit-gameplay/blob/release-L.x/UPGRADENOTES.md) file for more details on new Entity instancing rules.

### Goal
* *FEATURE* `BaseCollectorGoal` removed dependencies below changed to inherit from `Goal`:
  * `AutomateGeneratorsGoal`
  * `AutomateGeneratorTypeGoal`
  * `BuyGeneratorTypeGoal`
  * `CollectFromCollectorTypeGoal`
  * `CollectFromGeneratorTypeGoal`
  * `GetGeneratorUnitsForAllGeneratorsGoal`
  * `GetGeneratorUnitsForGeneratorsGoal`
  * `GetGeneratorUnitsForGeneratorTypeGoal`
  * `GetTotalGeneratorUnitsGoal`
  * `HitGeneratorUnitsTargetsGoal`.

### Installers
* *FEATURE* New `RemoteInstaller` added, which initializes Beamable related load phases, as the data now come from a remote host.

### Load Phases
* *FEATURE* New load phase `BaseContentDataLoadPhase` added, which is responsible for loading the new `IKManifest` from the Beamable server. This content load phase implements the new tag system, which allows Beamable to load only the specific data based on a `_contentTag`.
* *FEATURE* `BeamableContentDataProvider` added to handle multiple `IDataProvider`s coming from Beamable. This class aggregates them, and allows IdleKit to load them in one chunk. This conversion between multiple chunks of data and one single one was made because that is how IdleKit action system expects to handle data.
* *FEATURE* New load phase `InitializeBeamableLoadPhase` added which initializes Beamable.
* *FEATURE* New load phase `LoadContentDataLoadPhase` added which loads and binds one or more `IDataProvider`s to `IContainer`.
* *FEATURE* New load phase `RemoveContentDataLoadPhase` added which removes data from one or more `IDataProvider`s and unbinds the data from the `IContainer`.
* *CHANGE* `LoadContentLoadPhase`'s method `RunStartLogic` has been adjusted so it doesn't use `IEventService` to convert the entity id into an event id, as this procedure is no longer needed.
* *FEATURE* New load phase `ResetUserLoadPhase` added, which resets all remote User Data saved on the Beamable server.

### Stage
* *FEATURE* `GoalDataSequence`has been deprecated and replaced by `GoalTrack`s to manage the goals in a `Stage`.

### Startup
* *CHANGE* `IStartup` inteface no longer contains a list of content Ids the user can load into. See more details in our [UPGRADENOTES.md](https://github.com/Idlekit/idlekit-gameplay/blob/release-L.x/UPGRADENOTES.md) file.
* *CHANGE* `Startup` class refactored and cleaned up. `ResetUserLoadPhase` added to the `SetCleanupLoadPhases` method.
  * The new `ResetUserLoadPhase` takes care of resetting the load existing Beamable token and grabbing a new one for the currently starting session.
* *CHANGE* `GetGlobalData` and `GetContentData` methods have been deprecated from the `Startup` class.

### ITimerListener
* *FEATURE* Adding new progress property to `ITimerListener`. Updating implementations on dependencies below:
  * `AutoCollectState`
  * `CanvasEventView`
  * `CanvasReturnToMainContentView`
  * `EventService`
  * `EventSettings`
  * `ProductState`
  * `SerializationService`
  * `StandardContentFeatures`
  * `TimedBoost`
  * `StoreTimedReward`
  * `StoreUpgradeableCurrencyCollection`
  * `DummyTimerListener`
  * `TimerServiceTest`.

### Track
* *FEATURE* Added `IGlobalTrack` which is a Track that is active across different contents but only claimable in one specified content.

## Version L.0.0, 2020-11-18

### General
* *CHANGE* The following IdleKit 1.4 version repositories have been consolidated into the new `idlekit-core` and `idlekit-gameplay`:
  * The `idleKit-ioc` and `idlekit-logging` repos were moved into `idlekit-core`.
  * The `idleKit-framework` and `idlekit-implementation` repos were moved into `idlekit-gameplay`.
* *CHANGE* Formatting cleaned up to follow the IdleKit coding standard: Public properties renamed using upper camel case. Properties and methods access levels downgraded to protected where possible.

### Currency
* *FEATURE* Added `ICurrencyService.GetCurrencies<T>(Predicate<T> predicate)`.
* *FEATURE* Added `ICurrencyData.customRampingIncrement`, that overrides the ramping increment defined by the currency's `Rarity`.
* *CHANGE* `Currency` throws `CurrencyException` if trying to remove more currency than is available.

### Exchange Rate Multiplier
* *FEATURE* Added `IExchangeRateMultiplier.GetExchangeInputAmount(IExchangeable inputExchangeable, IExchangeable outputExchangeable, double outputAmount)`.

### Modifier
* *CHANGE* `IModifierCache` that returned an IEnumerable now returns a list instead to conform to the IdleKit standard, the in-function parameter remains IEnumerable.

### Rarity
* *FEATURE* Added `IRarityData.DefaultRampingIncrement` to specify the Rarity's ramping increment cost for purchasing an upgradeable currency from the Store Upgradeable Currency Collection.

### Reward
* *FEATURE* Added an `ITimeSkipReward` and implementation `TimeSkipReward` that grants the player a projected amount of `ICurrency` earnings based on the duration specified in data.

### Startup
* *CHANGE* Added the `AddDataPhase` and `RemoveDataPhase` to replace the following removed load phases:
  * `BaseContentDataLoadPhase`
  * `BaseGlobalDataLoadPhase`
  * `ClearContentDataLoadPhase`
  * `ClearGlobalDataLoadPhase`
  * `LoadContentDataLoadPhase`
  * `LoadGlobalDataLoadPhase`.

### Store
* *FEATURE* Introduced interfaces for `IStoreEntity`, `IStoreEntityData`.
* *FEATURE* Introduced interfaces for `IStoreReward`, `IStoreRewardData`.
* *FEATURE* Introduced interfaces for `IStoreUpgradeableCurrencyCollection`, `IStoreUpgradeableCurrencyCollectionData`, and `IStoreUpgradeableCurrencyCollectionSavedData`.
* *FEATURE* Added new `StoreEntity` Types:
  * StoreReward: An entity that grants an `IReward` to the player when it is purchased using virtual currency.
  * StoreUpgradeableCurrencyCollection: A refreshing collection of `IUpgradeableCurrency`s that the player can purchase using virtual currency.
* *FEATURE* Added `StageData.StoreUpgradeableCurrencyCollectionId` to specify the `StoreUpgradeableCurrencyCollection` that is available per stage.
* *FEATURE* Added `IStoreService` and `StoreService` that handles loading of `IStoreEntity`s.

### Stage
* *FEATURE* Added `IStageData.StoreUpgradeableCurrencyCollectionId` to specify the `StoreUpgradeableCurrencyCollection` that is available per stage.
