Skip to content

Commit 37730d9

Browse files
ToString override for objects
1 parent 1751d68 commit 37730d9

File tree

4 files changed

+17
-1
lines changed

4 files changed

+17
-1
lines changed

Assets/SO Architecture/Collections/Collection.cs

+4
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,8 @@ public IEnumerator<T> GetEnumerator()
7373
{
7474
return _list.GetEnumerator();
7575
}
76+
public override string ToString()
77+
{
78+
return "Collection<" + typeof(T) + ">(" + Count + ")";
79+
}
7680
}

Assets/SO Architecture/Events/Game Events/GameEventBase.cs

+4
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ public void RemoveListener(IGameEventListener<T> listener)
3838
if (_listeners.Contains(listener))
3939
_listeners.Remove(listener);
4040
}
41+
public override string ToString()
42+
{
43+
return "GameEventBase<" + typeof(T) + ">";
44+
}
4145
}
4246
public abstract class GameEventBase : SOArchitectureBaseObject, IGameEvent, IStackTraceObject
4347
{

Assets/SO Architecture/References/BaseReference.cs

+4
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ public TBase Value
2828
_constantValue = value;
2929
}
3030
}
31+
public override string ToString()
32+
{
33+
return Value.ToString();
34+
}
3135
}
3236

3337
//Can't get property drawer to work with generic arguments

Assets/SO Architecture/Variables/BaseVariable.cs

+5-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ public void SetValue(BaseVariable<T> value)
2626
{
2727
Value = value.Value;
2828
}
29-
29+
30+
public override string ToString()
31+
{
32+
return _value.ToString();
33+
}
3034
public static implicit operator T(BaseVariable<T> variable)
3135
{
3236
return variable.Value;

0 commit comments

Comments
 (0)