47 lines
1.2 KiB
C#
47 lines
1.2 KiB
C#
using Unity.Properties;
|
|
|
|
namespace DanieleMarotta.RiversongCodeShowcase
|
|
{
|
|
public class BuildMenuBuildingModel : UIModel
|
|
{
|
|
private BuildingDefinition _building;
|
|
|
|
private bool _isUnlocked;
|
|
|
|
private string _unlockConditions;
|
|
|
|
public BuildingDefinition Building
|
|
{
|
|
get => _building;
|
|
set
|
|
{
|
|
SetProperty(ref _building, value);
|
|
|
|
if (!_building) return;
|
|
|
|
BuildingName = _building.BuildingName;
|
|
NotifyPropertyChanged(nameof(BuildingName));
|
|
|
|
BuildingDescription = _building.BuildingDescription;
|
|
NotifyPropertyChanged(nameof(BuildingDescription));
|
|
}
|
|
}
|
|
|
|
[CreateProperty] public string BuildingName { get; private set; }
|
|
|
|
[CreateProperty] public string BuildingDescription { get; private set; }
|
|
|
|
public bool IsUnlocked
|
|
{
|
|
get => _isUnlocked;
|
|
set => SetProperty(ref _isUnlocked, value);
|
|
}
|
|
|
|
[CreateProperty]
|
|
public string UnlockConditions
|
|
{
|
|
get => _unlockConditions;
|
|
set => SetProperty(ref _unlockConditions, value);
|
|
}
|
|
}
|
|
} |