public static int GetPowerUpPrize(PlayerPowerUp powerUp)
        {
            int i = (int)(powerUp.Level * 512 * Math.Sqrt(powerUp.Level) * GetDifficultyMultiplier(true));
            if (actualPlanet == GameManager.PlayerCapital)
                return i;
            int lvlDiff = LevelManager.ActualLevel(actualPlanet.PlanetSettlement.CommerceLevel) - LevelManager.ActualLevel(GameManager.PlayerCapital.PlanetSettlement.CommerceLevel);
            if (lvlDiff <= 0)
                i /= 2;
            else
                i *= 2;
            if (ReturnLevelTypeForPowerUp(powerUp.Type, actualPlanet.PlanetSettlement) - ReturnLevelTypeForPowerUp(powerUp.Type, GameManager.PlayerCapital.PlanetSettlement) < 0)
                i /= 2;
            if (powerUp.Level > ReturnLevelTypeForPowerUp(powerUp.Type, GameManager.PlayerCapital.PlanetSettlement))
                i *= 4;
            if (GameManager.ActualSystemOwner.EmpireName == GameManager.PlayerEmpire.EmpireName)
                i /= 4;
            if (GameManager.ActualSystemOwner.ShowRelationWithPlayer().RelationPoints < 0)
                i *= 2;
            else
                i /= 2;

            if (i <= 0)
                i = 1;
            return i;
        }
        public static List<PlayerPowerUp> GetPowerUpList()
        {
            List<PlayerPowerUp> powerUps = new List<PlayerPowerUp>();
            List<PlayerPowerUp> player = PlayerShip.PowerUps;

            foreach (PlayerPowerUp.PowerUpType put in Enum.GetValues(typeof(PlayerPowerUp.PowerUpType)))
            {
                int level = ReturnLevelTypeForPowerUp(put, actualPlanet.PlanetSettlement);
                PlayerPowerUp p = new PlayerPowerUp(put, level);
                bool present = false;
                foreach(PlayerPowerUp ppu in player)
                    if(ppu.Level == p.Level && ppu.Type == p.Type)
                    {
                        present = true;
                        break;
                    }
                if (!present)
                    powerUps.Add(p);
            }

            return powerUps;
        }
 static Tuple<Texture2D, string> ReturnPowerUpTupleFromType(PlayerPowerUp.PowerUpType type)
 {
     Texture2D txt = foodIcon;
     string key;
     string name;
     switch (type)
     {
         case PlayerPowerUp.PowerUpType.CARGO:
             key = "CargoIcon";
             name = "Aumenta Carico";
             break;
         case PlayerPowerUp.PowerUpType.ENGINE:
             key = "EngineIcon";
             name = "Motore Interstellare";
             break;
         case PlayerPowerUp.PowerUpType.LASER:
             key = "LaserIcon";
             name = "Raggio Laser";
             break;
         case PlayerPowerUp.PowerUpType.ROCKET:
             key = "RocketIcon";
             name = "Razzi spaziali";
             break;
         case PlayerPowerUp.PowerUpType.SHIELD:
             key = "ShieldIcon";
             name = "Scudo";
             break;
         case PlayerPowerUp.PowerUpType.TERRAFORMER:
         default:
             key = "TerraformIcon";
             name = "Terraformatore";
             break;
     }
     powerUpTextures.TryGetValue(key, out txt);
     return new Tuple<Texture2D, string>(txt, name);
 }
 public static int GetMaxPowerUpLevel(PlayerPowerUp.PowerUpType type)
 {
     int level = 0;
     foreach(PlayerPowerUp pup in powerUps)
     {
         if (pup.Type == type && pup.Level > level)
             level = pup.Level;
     }
     return level;
 }
        public static bool AddNewPowerUp(PlayerPowerUp pup)
        {
            bool result = true;

            foreach(PlayerPowerUp p in powerUps)
            {//Se ha già quel potenziamento o ne ha uno di livello superiore torna false e non aggiungere nulla
                if (p.Type == pup.Type && p.Level >= pup.Level)
                    return false;
            }
            //Altrimenti aggiungilo e comportati di conseguenza
            switch(pup.Type)
            {
                case PlayerPowerUp.PowerUpType.CARGO:
                    maxCargo = 500 + 100 * pup.Level;
                    break;
                case PlayerPowerUp.PowerUpType.ENGINE:
                    radius = 1500 + 150 * pup.Level;
                    speed = 10 + (int)(2.5 * pup.Level);
                    break;
                case PlayerPowerUp.PowerUpType.LASER:
                    offensiveArmy = 50 + 5 * pup.Level;
                    break;
                case PlayerPowerUp.PowerUpType.SHIELD:
                    defensiveArmy = 50 + 5 * pup.Level;
                    break;
                case PlayerPowerUp.PowerUpType.ROCKET:
                case PlayerPowerUp.PowerUpType.TERRAFORMER:
                    break;
            }

            powerUps.Add(pup);
            return result;
        }
        static int ReturnLevelTypeForPowerUp(PlayerPowerUp.PowerUpType type, Settlement settlement)
        {
            int commerce = LevelManager.ActualLevel(settlement.CommerceLevel);
            int tecno = LevelManager.ActualLevel(settlement.TecnoLevel);
            int science = LevelManager.ActualLevel(settlement.ScienceLevel);

            int level = 1;
            switch (type)
            {
                case PlayerPowerUp.PowerUpType.CARGO:
                case PlayerPowerUp.PowerUpType.SHIELD:
                    level = commerce;
                    break;
                case PlayerPowerUp.PowerUpType.ENGINE:
                case PlayerPowerUp.PowerUpType.TERRAFORMER:
                    level = science;
                    break;
                case PlayerPowerUp.PowerUpType.LASER:
                case PlayerPowerUp.PowerUpType.ROCKET:
                    level = tecno;
                    break;

            }
            return level;
        }