Ejemplo n.º 1
0
 /// <summary>
 /// Registers entity with given ID. Do not call this directly, it is called automatically
 /// when EntityID is first time assigned.
 /// </summary>
 /// <param name="entity"></param>
 public static void AddEntityWithId(IMyEntity entity)
 {
     Debug.Assert(entity != null, "Adding null entity. This can't happen.");
     Debug.Assert(!m_entityList.ContainsKey(entity.EntityId), "Entity with this key (" + entity.EntityId + ") already exists in entity list! This can't happen.");
     Debug.Assert(!m_entityList.ContainsValue(entity), "Entity is already registered by different ID. This can't happen.");
     m_entityList.Add(entity.EntityId, entity);
 }