diff options
author | chai <chaifix@163.com> | 2020-12-30 20:59:04 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2020-12-30 20:59:04 +0800 |
commit | e9ea621b93fbb58d9edfca8375918791637bbd52 (patch) | |
tree | 19ce3b1c1f2d51eda6878c9d0f2c9edc27f13650 /Impostor-dev/src/Impostor.Server/Net/Inner/GameObject.cs |
+init
Diffstat (limited to 'Impostor-dev/src/Impostor.Server/Net/Inner/GameObject.cs')
-rw-r--r-- | Impostor-dev/src/Impostor.Server/Net/Inner/GameObject.cs | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/Impostor-dev/src/Impostor.Server/Net/Inner/GameObject.cs b/Impostor-dev/src/Impostor.Server/Net/Inner/GameObject.cs new file mode 100644 index 0000000..9b53d70 --- /dev/null +++ b/Impostor-dev/src/Impostor.Server/Net/Inner/GameObject.cs @@ -0,0 +1,29 @@ +using System.Collections.Generic; + +namespace Impostor.Server.Net.Inner +{ + internal class GameObject + { + public GameObject() + { + Components = new List<object>(); + } + + protected List<object> Components { get; } + + public List<T> GetComponentsInChildren<T>() + { + var result = new List<T>(); + + foreach (var component in Components) + { + if (component is T c) + { + result.Add(c); + } + } + + return result; + } + } +}
\ No newline at end of file |