-
Notifications
You must be signed in to change notification settings - Fork 0
/
Manager.cs
32 lines (25 loc) · 1.1 KB
/
Manager.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#region
using System;
using System.Collections.Generic;
using System.Linq;
#endregion
namespace VeeEntity
{
public class Manager
{
internal readonly Repository Repository;
public Manager() { Repository = new Repository(); }
public void Clear() { Repository.Clear(); }
public IEnumerable<Entity> GetEntities() { return Repository.GetEntities(); }
public IEnumerable<Entity> GetEntitiesByTag(string mTag) { return Repository.GetEntitiesByTag(mTag); }
public IEnumerable<Entity> GetEntitiesByComponent(Type mType) { return Repository.GetEntitiesByComponent(mType); }
public IEnumerable<Component> GetComponents(Type mType) { return Repository.GetComponents(mType); }
public bool HasEntityByTag(string mTag) { return GetEntitiesByTag(mTag).Any(); }
public bool HasEntityByComponent(Type mType) { return GetEntitiesByComponent(mType).Any(); }
public void Update(float mFrameTime)
{
foreach (var entity in new List<Entity>(Repository.GetEntities()))
entity.Update(mFrameTime);
}
}
}