Skip to content

Commit c646058

Browse files
author
Baptiste SUZON
committed
feat: Added getUtility and getStat function
1 parent 38f27b8 commit c646058

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

Runtime/UtilitySystem.cs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,17 @@ public Utility GetHighestUtility()
6868
return max;
6969
}
7070

71+
public Utility GetUtilty(string key)
72+
{
73+
if (_outputs.ContainsKey(key))
74+
return _outputs[key];
75+
else
76+
{
77+
Debug.Log($"UtilitySystem does not contain {key}");
78+
return null;
79+
}
80+
}
81+
7182
public Dictionary<string, Utility> GetUtilities()
7283
{
7384
return _outputs;
@@ -95,5 +106,17 @@ public Dictionary<string, Stat> GetInputs()
95106
{
96107
return _inputs;
97108
}
109+
110+
public Stat GetStat(string key)
111+
{
112+
if (_inputs.ContainsKey(key))
113+
return _inputs[key];
114+
else
115+
{
116+
Debug.Log($"UtilitySystem does not contain {key}");
117+
return null;
118+
}
119+
}
120+
98121
}
99122
}

0 commit comments

Comments
 (0)