ZEPETO.Multiplay.Inventory
11 分
型 説明 inventoryerror /#inventoryerror インベントリ関連のリクエストが失敗した理由を示すエラーコード。 inventoryrecord /#inventoryrecord インベントリ内の商品の情報。 inventory /#inventory inventory は、プレイヤーの world 内商品インベントリに関連する操作を管理します。 inventoryerror enum インベントリ関連のリクエストが失敗した理由を示すエラーコード。 名前 値 説明 unknown 1 エラー 不明なエラー。 networkerror 0 エラー 接続の切断や不安定な接続など、ネットワークに関連するエラー。 inventoryrecord interface インベントリ内の商品の情報。 プロパティ 名前 型 説明 productid string 商品の id。 quantity number 商品の数量。 createdat date 商品がインベントリに追加された日時。 updatedat date 商品情報が最後に更新された日時。 inventory interface inventory は、プレイヤーの world 内商品インベントリに関連する操作を管理します。 メソッド use use(productid string, quantity? number, reason? string) → promise\<boolean> プレイヤーのインベントリから world 内商品を使用します。 inventoryerror をスローします。 パラメーター 型 説明 productid string 使用する商品の id。 quantity (省略可能) number 使用する商品の数量。デフォルト値は 1 です。 reason (省略可能) string 使用理由を任意で記述します。 戻り値 promise\<boolean> — 処理の完了時に解決される promise 。成功時は true 、失敗時は false を示します。 add add(productid string, quantity? number, reason? string) → promise\<boolean> プレイヤーのインベントリに world 内商品を追加します。 inventoryerror をスローします。 パラメーター 型 説明 productid string 追加する商品の id。 quantity (省略可能) number 追加する商品の数量。デフォルト値は 1 です。 reason (省略可能) string 追加の理由を任意で記述します。 戻り値 promise\<boolean> — 処理の完了時に解決される promise 。成功時は true 、失敗時は false を示します。 madd madd(products { productid string; quantity number; reason? string }\[]) → promise\<boolean> プレイヤーのインベントリに複数の world 内商品を追加します。 inventoryerror をスローします。 パラメーター 型 説明 products { productid string; quantity number; reason? string }\[] 追加する商品の配列。 戻り値 promise\<boolean> — 処理の完了時に解決される promise 。成功時は true 、失敗時は false を示します。 has has(productid string) → promise\<boolean> プレイヤーのインベントリに world 内商品が存在するかどうかを確認します。 inventoryerror をスローします。 パラメーター 型 説明 productid string 確認する商品の id。 戻り値 promise\<boolean> — 処理の完了時に解決される promise 。存在する場合は true 、存在しない場合は false を示します。 get get(productid string) → promise\<inventoryrecord | null> プレイヤーのインベントリから world 内商品を取得します。 inventoryerror をスローします。 パラメーター 型 説明 productid string 取得する商品の id。 戻り値 promise\<inventoryrecord | null> — 処理の完了時に、取得した inventoryrecord オブジェクトとともに解決される promise 。 remove remove(productid string) → promise\<boolean> プレイヤーのインベントリから world 内商品を削除します。 inventoryerror をスローします。 パラメーター 型 説明 productid string 削除する商品の id。 戻り値 promise\<boolean> — 処理の完了時に解決される promise 。成功時は true 、失敗時は false を示します。 list list() → promise\<inventoryrecord\[]> プレイヤーのインベントリからすべての world 内商品を取得します。 inventoryerror をスローします。 戻り値 promise\<inventoryrecord\[]> — 処理の完了時に、取得した inventoryrecord オブジェクトの配列とともに解決される promise 。