using UnityEngine; using System.Collections.Generic; /// /// Data-only structure for shop generation (not a MonoBehaviour) /// Used by SettlementContext to define shop properties /// [System.Serializable] public class ShopData { public string buildingName; public ShopType shopType; public string shopkeeperName; public Vector2Int gridPosition; public Color buildingColor; public bool isAvailable; public ShopData(string name, ShopType type, string keeper, Vector2Int position, Color color) { buildingName = name; shopType = type; shopkeeperName = keeper; gridPosition = position; buildingColor = color; isAvailable = true; } /// /// Convert this ShopData to a TownShop component on the given GameObject /// public TownShop ApplyToTownShop(GameObject shopObject) { var townShop = shopObject.GetComponent(); if (townShop == null) townShop = shopObject.AddComponent(); townShop.buildingName = buildingName; townShop.shopType = shopType; townShop.shopkeeperName = shopkeeperName; townShop.gridPosition = gridPosition; townShop.buildingColor = buildingColor; return townShop; } }