riversong code showcase
This commit is contained in:
25
Source/Riversong/Game/Unlocks/UnlocksState.cs
Normal file
25
Source/Riversong/Game/Unlocks/UnlocksState.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace DanieleMarotta.RiversongCodeShowcase
|
||||
{
|
||||
public class UnlocksState
|
||||
{
|
||||
private Dictionary<int, int> _buildingUnlockLookup = new();
|
||||
|
||||
public HashSet<int> Unlocked { get; } = new();
|
||||
|
||||
public HashSet<int> UnlockedBuildings { get; } = new();
|
||||
|
||||
public HashSet<int> TeasedBuildings { get; } = new();
|
||||
|
||||
public void AddBuildingUnlock(BuildingDefinition building, int unlockId)
|
||||
{
|
||||
_buildingUnlockLookup.Add(building.RuntimeId, unlockId);
|
||||
}
|
||||
|
||||
public bool TryGetBuildingUnlock(BuildingDefinition building, out int unlockId)
|
||||
{
|
||||
return _buildingUnlockLookup.TryGetValue(building.RuntimeId, out unlockId);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user