OSK Logo OSK.Hub

Provisions

Source: GitHub GitHub

Packages: NuGet NuGet

Summary

Every game requires the ability to manage player resources and transfer them between transactions. Provisions is meant to provide shared logic to handle these transactions for game applications, and provide easy ways to manage and validate a transaction. These transactions can encompass gold for items, mana for magic, or any other style of “need x resource to do y thing”.

The core component is the ProvisionCalculator which is able to perform these calculations and return various Provision expenditure results for a given set of in-game resources. Additionally, it’s able to calculate refunds for transactions, while taking into account potential discounts or other desired reductions.

Furthermore, a ProvisionSet can be utilized to handle multiple different provisions simultaneously. Essentially acting as a resource bank, provision sets can be used to compare player economies, purchases or transactions spanning multiple provisions at once (e.g. gold, lumber, etc.), and more.

Godot Integration

The godot provision integration serves primarily as a shared data configuration library for provisions that can be used within a godot game application. The following are key components to the integration library:

In order for the definition repository to function, users will need to: