public AnimatedSprite(string name, AnimationCollection collection, IResourceManager resourceManager)
        {
            AnimationStates = new Dictionary<string, AnimationState>();
            Name = name;
            LoadSprites(collection, resourceManager);
            if (AnimationStates.ContainsKey("idle"))
                SetAnimationState("idle");
            SetLoop(true);
            SetCurrentSprite();

            //IoCManager.Resolve<IResourceManager>().
        }
        //Todo encapsulate this further down as components -- AnimatedSpriteState, AnimatedSpriteStateDirection
        public void LoadSprites(AnimationCollection collection, IResourceManager resourceManager)
        {
            float x = 0, y = 0, h = 0, w = 0;
            int t = 0;
            foreach (var info in collection.Animations)
            {
                _sprites.Add(info.Name, new Dictionary<Direction, SFML.Graphics.Sprite[]>());

                //Because we have a shitload of frames, we're going to store the average size as the AABB for each direction and each animation
                _averageAABBs.Add(info.Name, new Dictionary<Direction, FloatRect>());

                var sprites = _sprites[info.Name];
                var averageAABBs = _averageAABBs[info.Name];
                AnimationStates.Add(info.Name, new AnimationState(info));
                foreach (var dir in Enum.GetValues(typeof(Direction)).Cast<Direction>())
                {
                    sprites.Add(dir, new SFML.Graphics.Sprite[info.Frames]);
                    var thisDirSprites = sprites[dir];
                    for (var i = 0; i < info.Frames; i++)
                    {
                        var spritename = collection.Name.ToLowerInvariant() + "_" + info.Name.ToLowerInvariant() + "_"
                                         + DirectionToUriComponent(dir) + "_" + i;
                        thisDirSprites[i] = resourceManager.GetSprite(spritename);
                        var bounds = thisDirSprites[i].GetLocalBounds();
                        x += bounds.Left;
                        y += bounds.Top;
                        w += bounds.Width;
                        h += bounds.Height;
                        t++;
                    }
                    averageAABBs.Add(dir, new FloatRect(x / t, y / t, w / t, h / t));
                    t = 0;
                    x = 0;
                    y = 0;
                    w = 0;
                    h = 0;
                }
            }
        }