64 lines
1.7 KiB
C#
64 lines
1.7 KiB
C#
using Unity.Properties;
|
|
using UnityEngine;
|
|
|
|
namespace DanieleMarotta.RiversongCodeShowcase
|
|
{
|
|
public class BuildingPanelModel : UIModel
|
|
{
|
|
private Building _building;
|
|
|
|
private string _buildingName;
|
|
|
|
private string _buildingDescription;
|
|
|
|
private Sprite _buildingIcon;
|
|
|
|
private bool _showNoHouseNearbyWarning;
|
|
|
|
public Building Building
|
|
{
|
|
get => _building;
|
|
private set => SetProperty(ref _building, value);
|
|
}
|
|
|
|
[CreateProperty]
|
|
public string BuildingDescription
|
|
{
|
|
get => _buildingDescription;
|
|
private set => SetProperty(ref _buildingDescription, value);
|
|
}
|
|
|
|
[CreateProperty]
|
|
public string BuildingName
|
|
{
|
|
get => _buildingName;
|
|
private set => SetProperty(ref _buildingName, value);
|
|
}
|
|
|
|
[CreateProperty]
|
|
public Sprite BuildingIcon
|
|
{
|
|
get => _buildingIcon;
|
|
private set => SetProperty(ref _buildingIcon, value);
|
|
}
|
|
|
|
[CreateProperty]
|
|
public bool ShowNoHouseNearbyWarning
|
|
{
|
|
get => _showNoHouseNearbyWarning;
|
|
set => SetProperty(ref _showNoHouseNearbyWarning, value);
|
|
}
|
|
|
|
public HousePanelModel HouseModel { get; } = new();
|
|
|
|
public StoragePanelModel StorageModel { get; } = new();
|
|
|
|
public void SetBuilding(Building building)
|
|
{
|
|
Building = building;
|
|
BuildingName = Building?.Definition.BuildingName;
|
|
BuildingDescription = Building?.Definition.BuildingDescription;
|
|
BuildingIcon = Building?.Definition.Icon;
|
|
}
|
|
}
|
|
} |