Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

SingleUseGood

The SingleUseGood item is a consumable good item with a specific balance. More...

Import Statement: import Felgo 4.0
Inherits:

Item

Properties

Detailed Description

A SingleUseGood item is the most basic kind of a virtual good. It is a virtual item that a player can only use once before he has to purchase more of the same kind again. SingleUseGood items be purchased an unlimited number of times. These goods can normally be summed up and accumulated so that the user has a balance of them (e.g. 20 green balls). The balance of every virtual item is saved within an internal database and can be retrieved with balance property. Single use goods are commonly purchased with a virtual currency with the VirtualPurchase type.

A simple example for an additional one time usage weapon for Squaby looks like the following:

 Store {
   goods: [
     SingleUseGood {
       id: vacGood
       itemId: "vac_item_id"
       name: "Vacuum Cleaner"
       description: "All Squabies are sucked in by your mom's vacuum cleaner"
       purchaseType: VirtualPurchase { itemId: goldCurrency.itemId; amount: 50; }
     }
   ]
 }

Property Documentation

balance : int

A read-only property which holds the current balance of purchased items of this type in the inventory. You can use property binding to display the current amount of items available with the help of a Text item:

 Text {
   text: "Available Vacuum Cleaners: %1".arg(vacGood.balance)
 }

description : string

A meta field for giving the item a description to display to the user. This property is not used internally but you can use it to display a common description within your game wherever you need to.

Be sure to set this property if you're making use of Store::printStoreProductLists as this greatly simplifies the publishing process of your game.


itemId : string

The itemId is a unique identifier for this item within your virtual store. The property is mandatory.


name : string

A meta field for giving the item a name to display to the user. This property is not used internally but you can use it to display a common name within your game wherever you need to.

Be sure to set this property if you're making use of Store::printStoreProductLists as this greatly simplifies the publishing process of your game.


purchaseType : PurchaseType

The purchaseType property defines how the item can be purchased. Possible values are instances of StorePurchase or VirtualPurchase. If you use the virtual economy model shipped with the Store plugin the VirtualPurchase type is preferred.

This property is mandatory. For convenience, you can reuse the currency pack's itemId for the purchase type's itemId or productId like in the example below. Keep however in mind that on iOS productIds must be unique across all your games and therefore should be prefixed for StorePurchase purchase types (see StorePurchase::productId for more details).

 SingleUseGood {
   id: vacGood
   itemId: "vac_item_id"
   name: "Vacuum Cleaner"
   description: "All Squabies are sucked in by your mom's vacuum cleaner"
   purchaseType:  VirtualPurchase { itemId: goldCurrency.itemId; amount: 50; }
 }

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded