Skip to content

Commit

Permalink
Placement metadata complete wiring.
Browse files Browse the repository at this point in the history
  • Loading branch information
zyro committed Jun 22, 2024
1 parent 189f906 commit 48049e5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion economy.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,14 @@ type EconomyConfigStoreItemCost struct {
Sku string `json:"sku,omitempty"`
}

// EconomyPlacementInfo contains information about a placement instance.
type EconomyPlacementInfo struct {
// Placement configuration.
Placement *EconomyConfigPlacement `json:"placement,omitempty"`
// Metadata, if any was set when the placement was started.
Metadata map[string]string `json:"metadata,omitempty"`
}

// The EconomySystem is the foundation of a game's economy.
//
// It provides functionality for 4 different reward types: basic, gacha, weighted table, and custom. These rolled
Expand Down Expand Up @@ -248,7 +256,7 @@ type EconomySystem interface {
SetOnDonationContributorReward(fn OnReward[*EconomyConfigDonation])

// SetOnPlacementReward sets a custom reward function which will run after a placement's reward is rolled.
SetOnPlacementReward(fn OnReward[*EconomyConfigPlacement])
SetOnPlacementReward(fn OnReward[*EconomyPlacementInfo])

// SetOnStoreItemReward sets a custom reward function which will run after store item's reward is rolled.
SetOnStoreItemReward(fn OnReward[*EconomyConfigStoreItem])
Expand Down

0 comments on commit 48049e5

Please sign in to comment.