Exemplo n.º 1
0
        public RevolutionEntity CreateIdentEntityInChunk <TIdentity>(TIdentity identity, RevolutionChunk chunk)
        {
            var ent = CreateEntityInChunk(chunk);
            var id  = new EntityIdentifier();

            id.Set(identity);
            identifierToEntity.Set(id, ent.Raw);

            return(ent);
        }
Exemplo n.º 2
0
        /// <summary>
        ///     Get an entity from an identifier
        /// </summary>
        /// <param name="identity"></param>
        /// <typeparam name="TIdentity"></typeparam>
        /// <returns></returns>
        public RevolutionEntity GetEntityFromIdentifier <TIdentity>(TIdentity identity)
        {
            var id = new EntityIdentifier();

            id.Set(identity);
            if (identifierToEntity.TryGetValue(id, out var entity))
            {
                return(new RevolutionEntity(this, entity));
            }
            return(default);