/// <summary>
        /// Nacteni hrdinovejch textur a animaci
        /// </summary>
        /// <param name="gender"></param>
        public static void LoadHeroSprite(string gender)
        {
            //Nahrani hera
            #region Hero load
            Texture2D playerTexture;
            if (gender == "Male")
                playerTexture = GameRef.Content.Load<Texture2D>(@"Sprites\malefighter");
            else
                playerTexture = GameRef.Content.Load<Texture2D>(@"Sprites\femalefighter");

            Dictionary<AnimationKey, Animation>  animations = new Dictionary<AnimationKey, Animation>();
            Animation animation = new Animation(3, 32, 32, 0, 0);
            animations.Add(AnimationKey.Down, animation);
            animation = new Animation(3, 32, 32, 0, 32);
            animations.Add(AnimationKey.Left, animation);
            animation = new Animation(3, 32, 32, 0, 64);
            animations.Add(AnimationKey.Right, animation);
            animation = new Animation(3, 32, 32, 0, 96);
            animations.Add(AnimationKey.Up, animation);
            playerSpriteHero = new AnimatedSprite(playerTexture, animations);
            playerSpriteHero.IsAnimating = false;

            #endregion
        }
 private Animation(Animation animation)
 {
     this.frames = animation.frames;
     FramesPerSecond = 5;
 }
 /// <summary>
 /// Nacteni vsech textur a animaci jednotek
 /// </summary>
 public static void LoadBases()
 {
     List<AnimatedSprite> sprites = new List<AnimatedSprite>();
     baseUnits = new Dictionary<string, Unit>();
     baseKeys = new Dictionary<int, GameKey>();
     for (int k = 0; k < 3; k++)
     {
         for (int i = 0; i < 10; i++)
         {
             AnimatedSprite sprite;
             Dictionary<AnimationKey, Animation> animations = new Dictionary<AnimationKey, Animation>();
             Animation animation;
             animation = new Animation(2, 32, 32, i * 64, k * 128 + 0);
             animations.Add(AnimationKey.Up, animation);
             animation = new Animation(2, 32, 32, i * 64, k * 128 + 32);
             animations.Add(AnimationKey.Right, animation);
             animation = new Animation(2, 32, 32, i * 64, k * 128 + 64);
             animations.Add(AnimationKey.Down, animation);
             animation = new Animation(2, 32, 32, i * 64, k * 128 + 96);
             animations.Add(AnimationKey.Left, animation);
             sprite = new AnimatedSprite(charTexture, animations);
             sprites.Add(sprite);
         }
     }
     for (int i = 0; i < 4; i++)
     {
         AnimatedSprite sprite;
         Dictionary<AnimationKey, Animation> animations = new Dictionary<AnimationKey, Animation>();
         Animation animation;
         animation = new Animation(4, 32, 32, 0, i * 32);
         animations.Add(AnimationKey.Down, animation);
         sprite = new AnimatedSprite(keyTexture, animations);
         sprites.Add(sprite);
     }
     baseUnits.Add("zena1", new Unit("zena1", 0, 0, sprites[0], 0, 0, new AttributePair(50)));
     baseUnits.Add("zena2", new Unit("zena2", 0, 0, sprites[1], 0, 0, new AttributePair(50)));
     baseUnits.Add("kaspar", new Unit("kaspar", 0, 0, sprites[2], 0, 0, new AttributePair(50)));
     baseUnits.Add("vdova", new Unit("vdova", 0, 0, sprites[3], 0, 0, new AttributePair(50)));
     baseUnits.Add("cernokneznik", new Unit("cernokneznik", 0, 0, sprites[4], 0, 0, new AttributePair(50)));
     baseUnits.Add("hunac", new Unit("hunac", 0, 0, sprites[5], 0, 0, new AttributePair(50)));
     baseUnits.Add("sliz", new Unit("sliz", 0, 0, sprites[6], 0, 0, new AttributePair(50)));
     baseUnits.Add("krab", new Unit("krab", 0, 0, sprites[7], 0, 0, new AttributePair(50)));
     baseUnits.Add("motyl", new Unit("motyl", 0, 0, sprites[8], 0, 0, new AttributePair(50)));
     baseUnits.Add("ptak", new Unit("ptak", 0, 0, sprites[9], 0, 0, new AttributePair(50)));
     baseUnits.Add("hroch", new Unit("hroch", 0, 0, sprites[10], 0, 0, new AttributePair(50)));
     baseUnits.Add("moucha", new Unit("moucha", 0, 0, sprites[11], 0, 0, new AttributePair(50)));
     baseUnits.Add("moucha1", new Unit("moucha", 0, 0, sprites[11], 0, 0, new AttributePair(50)));
     baseUnits.Add("moucha2", new Unit("moucha", 0, 0, sprites[11], 0, 0, new AttributePair(50)));
     baseUnits.Add("hydra", new Unit("hydra", 0, 0, sprites[12], 0, 0, new AttributePair(50)));
     baseUnits.Add("srdce", new Unit("srdce", 0, 0, sprites[13], 0, 0, new AttributePair(50)));
     baseUnits.Add("rohac", new Unit("rohac", 0, 0, sprites[14], 0, 0, new AttributePair(50)));
     baseUnits.Add("zena3", new Unit("zena3", 0, 0, sprites[15], 0, 0, new AttributePair(50)));
     baseUnits.Add("bilokneznik", new Unit("bilokneznik", 0, 0, sprites[16], 0, 0, new AttributePair(50)));
     baseUnits.Add("meduza", new Unit("meduza", 0, 0, sprites[17], 0, 0, new AttributePair(50)));
     baseUnits.Add("meduzak", new Unit("meduzak", 0, 0, sprites[18], 0, 0, new AttributePair(50)));
     baseUnits.Add("smrt", new Unit("smrt", 15, 10, sprites[19], 0, 0, new AttributePair(50)));
     baseUnits.Add("lizard1", new Unit("lizard1", 0, 0, sprites[20], 0, 0, new AttributePair(50)));
     baseUnits.Add("lizard2", new Unit("lizard2", 0, 0, sprites[21], 0, 0, new AttributePair(50)));
     baseUnits.Add("demon", new Unit("demon", 0, 0, sprites[22], 0, 0, new AttributePair(50)));
     baseUnits.Add("pes", new Unit("pes", 0, 0, sprites[23], 0, 0, new AttributePair(50)));
     baseUnits.Add("kytka", new Unit("kytka", 0, 0, sprites[24], 0, 0, new AttributePair(50)));
     baseUnits.Add("kostlivec", new Unit("kostlivec", 0, 0, sprites[25], 0, 0, new AttributePair(50)));
     baseUnits.Add("poutnik", new Unit("poutnik", 0, 0, sprites[26], 0, 0, new AttributePair(50)));
     baseUnits.Add("drak", new Unit("drak", 0, 0, sprites[27], 0, 0, new AttributePair(50)));
     baseUnits.Add("diamant", new Unit("diamant", 0, 0, sprites[28], 0, 0, new AttributePair(50)));
     baseUnits.Add("kentaur", new Unit("kentaur", 0, 0, sprites[29], 0, 0, new AttributePair(50)));
     baseKeys.Add(1, new GameKey(1, sprites[30], 0, 0));
     baseKeys.Add(2, new GameKey(2, sprites[31], 0, 0));
     baseKeys.Add(3, new GameKey(3, sprites[32], 0, 0));
     baseKeys.Add(4, new GameKey(4, sprites[33], 0, 0));
 }
 /// <summary>
 /// Naklonovani jedne animace
 /// </summary>
 /// <returns></returns>
 public object Clone()
 {
     Animation animationClone = new Animation(this);
     animationClone.frames = this.frames;
     animationClone.frameWidth = this.frameWidth;
     animationClone.frameHeight = this.frameHeight;
     animationClone.Reset();
     return animationClone;
 }