public void AddTagToEntity(long entityId, string tag) { if (!tags.ContainsKey(entityId)) { tags.DefineNew(entityId); } tags.AddTo(entityId, tag); }
private void Associate(Type index) { if (!collectionMap.ContainsKey(index)) { collectionMap[index] = new List <SystemBase>(); } else { LogEvent.Engine.Warning("Map is already associated to " + index.Name); } }
internal void RegisterEntityToSystem(Entity entity, SystemBase system) { if (!entitiesBySystem.ContainsKey(system.Id)) { entitiesBySystem.DefineNew(system.Id); } if (!entitiesBySystem[system.Id].Contains(entity)) { entitiesBySystem[system.Id].Add(entity); scene.Messenger.SendToSystem(new EntityChangeMessage(entity, UpdateType.Add), system, false); } }