Ejemplo n.º 1
0
 public IEnumerable<World> GetWorlds()
 {
     using (var context = new ObjectPathContext())
     {
         return context.Worlds.ToList();
     }
 }
Ejemplo n.º 2
0
 public async Task<Animation> GetAnimationAsync(int worldId, string animationName)
 {
     using (var context = new ObjectPathContext())
     {
         return await _animationLocator.GetResourceAsync(await context.Animations.SingleOrDefaultAsync(entity => entity.WorldId == worldId && entity.Name == animationName));
     }
 }
Ejemplo n.º 3
0
 public async Task<byte[]> GetTextureAsync(int worldId, string textureName)
 {
     using (var context = new ObjectPathContext())
     {
         return await _textureLocator.GetResourceAsync(await context.Textures.SingleOrDefaultAsync(entity => entity.WorldId == worldId && entity.Name == textureName));
     }
 }
Ejemplo n.º 4
0
 public async Task<Model> GetModelAsync(int worldId, string modelName)
 {
     using (var context = new ObjectPathContext())
     {
         return await _modelLocator.GetResourceAsync(await context.Models.SingleOrDefaultAsync(entity => entity.WorldId == worldId && entity.Name == modelName));
     }
 }
Ejemplo n.º 5
0
        public async Task<IEnumerable<Model>> GetWorldModels(int id)
        {
            using (var context = new ObjectPathContext())
            {
                var world = await context.Worlds.FindAsync(id);

                return world == null ? Enumerable.Empty<Model>() : world.Models;
            }
        }
Ejemplo n.º 6
0
        public async Task<IEnumerable<Animation>> GetWorldAnimations(int id)
        {
            using (var context = new ObjectPathContext())
            {
                var world = await context.Worlds.FindAsync(id);

                return world == null ? Enumerable.Empty<Animation>() : world.Animations;
            }
        }