Beispiel #1
0
        private String GetProgressBasedText()
        {
            var currentPhase = MissionManager.GetCurrentGamePhase();

            switch (currentPhase)
            {
            case GamePhase.beginning:
            {
                return(MathFunctions.PickRandomFromList <String>(beginningText));
            }

            case GamePhase.withAlliance:
            {
                return(MathFunctions.PickRandomFromList <String>(beginningText));
            }

            case GamePhase.withRebels:
            {
                return(MathFunctions.PickRandomFromList <String>(beginningText));
            }

            case GamePhase.ending:
            {
                return(MathFunctions.PickRandomFromList <String>(beginningText));
            }

            default:
            {
                throw new ArgumentException(string.Format("Unknown argument given: {0}", currentPhase.ToString()));
            }
            }
        }
        private Item GetProgressBasedRandomItem(Game1 Game)
        {
            var currentPhase = MissionManager.GetCurrentGamePhase();

            ShipPartType        progressRandomShipPart;
            List <ShipPartType> pickingPool = new List <ShipPartType>();

            pickingPool.AddRange(beginningItems);

            switch (currentPhase)
            {
            case GamePhase.beginning:
            {
                progressRandomShipPart = MathFunctions.PickRandomFromList(pickingPool);
                break;
            }

            case GamePhase.withAlliance:
            {
                pickingPool.AddRange(alliancePhaseItems);
                progressRandomShipPart = MathFunctions.PickRandomFromList(pickingPool);
                break;
            }

            case GamePhase.withRebels:
            {
                pickingPool.AddRange(alliancePhaseItems);
                pickingPool.AddRange(rebelPhaseItems);
                progressRandomShipPart = MathFunctions.PickRandomFromList(pickingPool);
                break;
            }

            case GamePhase.ending:
            {
                pickingPool.AddRange(alliancePhaseItems);
                pickingPool.AddRange(rebelPhaseItems);
                pickingPool.AddRange(endingItems);
                progressRandomShipPart = MathFunctions.PickRandomFromList(pickingPool);
                break;
            }

            default:
            {
                throw new ArgumentException(string.Format("Unknown argument given: {0}", currentPhase.ToString()));
            }
            }

            ItemVariety variety = GetRandomVariety();

            return(Shop.RetrievePartFromEnum(progressRandomShipPart, Game, variety));
        }
        public String GetProgressBasedLevel()
        {
            var currentPhase = MissionManager.GetCurrentGamePhase();

            switch (currentPhase)
            {
            case GamePhase.beginning:
            case GamePhase.withAlliance:
                return(MathFunctions.PickRandomFromList(rebelPirates));

            case GamePhase.withRebels:
            case GamePhase.ending:
                return(MathFunctions.PickRandomFromList(alliancePirates));

            default:
                throw new ArgumentException(string.Format("Unknown argument: {1}", currentPhase));
            }
        }