using System.Collections.Generic; using UnityEngine; namespace CryingSnow.FarmingIsland { [System.Serializable] public class GameData { // The amount of in-game currency (coins) public int Coin { get; set; } // List of islands that have been unlocked (true = unlocked, false = locked) public List UnlockedIslands { get; set; } // List of purchasers that available public List Purchasers { get; set; } // Database of inventory data for various inventories public List InventoryDatabase { get; set; } // Database of silo data for various silos public List SiloDatabase { get; set; } // Levels of animals indexed by animal type public int[] AnimalLevels { get; set; } /// /// Initializes a new instance of the GameData class with specified values. /// /// The initial amount of coins. /// List indicating which islands are unlocked. public GameData(int coin, List unlockedIslands) { Coin = coin; UnlockedIslands = unlockedIslands; Purchasers = new List(); InventoryDatabase = new List(); SiloDatabase = new List(); AnimalLevels = new int[System.Enum.GetValues(typeof(AnimalType)).Length]; } } [System.Serializable] public class InventoryData { // Unique identifier for the inventory public string InventoryId { get; set; } // List of items in the inventory public List Items { get; set; } /// /// Initializes a new instance of the InventoryData class with specified values. /// /// The unique identifier for the inventory. /// List of items contained in the inventory. public InventoryData(string inventoryId, List items) { InventoryId = inventoryId; Items = items; } } [System.Serializable] public class SiloData { // Unique identifier for the silo public string SiloId { get; set; } // Current level of the silo public int SiloLevel { get; set; } // Levels of farmers associated with this silo public List FarmerLevels { get; set; } /// /// Initializes a new instance of the SiloData class with specified values. /// /// The unique identifier for the silo. /// The current level of the silo. /// List of levels for farmers associated with the silo. public SiloData(string siloId, int siloLevel, List farmerLevels) { SiloId = siloId; SiloLevel = siloLevel; FarmerLevels = farmerLevels; } } [System.Serializable] public class PurchaserData { // Location of the Purchaser. public int x { get; set; } public int y { get; set; } public int z { get; set; } public Vector3Int Position => new Vector3Int(x, y, z); // The current price to be deducted during the purchase. public int Price { get; set; } public PurchaserData(Vector3Int position, int price) { x = position.x; y = position.y; z = position.z; this.Price = price; } } }