RuneHive-Game
Loading...
Searching...
No Matches
com.runehive.content.store.PersonalStoreSaver Class Reference

Static Public Member Functions

static void loadPayments ()
static void savePayments ()

Static Private Attributes

static final String PAYMENT_PATH = "/def/content/game/personal_stores_payments.json"

Detailed Description

Definition at line 13 of file PersonalStoreSaver.java.

Member Function Documentation

◆ loadPayments()

void com.runehive.content.store.PersonalStoreSaver.loadPayments ( )
static

Definition at line 27 of file PersonalStoreSaver.java.

27 {
28 Path path = Paths.get("data", PAYMENT_PATH);
29
30 if (!Files.exists(path)) {
31 return;
32 }
33
34 try (FileReader reader = new FileReader(path.toFile())) {
35 JsonParser parser = new JsonParser();
36 //PersonalStore.SOLD_ITEMS = new GsonBuilder().create().fromJson(parser.parse(reader), type);
37 } catch (Exception e) {
38 e.printStackTrace();
39 }
40 }

References PAYMENT_PATH.

◆ savePayments()

void com.runehive.content.store.PersonalStoreSaver.savePayments ( )
static

Definition at line 17 of file PersonalStoreSaver.java.

17 {
18 Thread.startVirtualThread(() -> {
19 try (FileWriter fw = new FileWriter("./data" + PAYMENT_PATH)) {
20 fw.write(GsonUtils.JSON_PRETTY_ALLOW_NULL.get().toJson(PersonalStore.SOLD_ITEMS));
21 } catch (final Exception e) {
22 e.printStackTrace();
23 }
24 });
25 }

References com.runehive.util.GsonUtils.JSON_PRETTY_ALLOW_NULL, PAYMENT_PATH, and com.runehive.content.store.impl.PersonalStore.SOLD_ITEMS.

Member Data Documentation

◆ PAYMENT_PATH

final String com.runehive.content.store.PersonalStoreSaver.PAYMENT_PATH = "/def/content/game/personal_stores_payments.json"
staticprivate

Definition at line 15 of file PersonalStoreSaver.java.

Referenced by loadPayments(), and savePayments().


The documentation for this class was generated from the following file: