public void SetInhabitantDevelopmentLevelForStarfarers(StarfarerInhabitantDevelopmentLevel level)
 {
     if (level == StarfarerInhabitantDevelopmentLevel.Colony)
     {
         _inhabitantDevelopment = new DocContentItem("Colony", 41);
         ReduceAllResources(Globals.RollD5());
     }
     else if (level == StarfarerInhabitantDevelopmentLevel.OrbitalHabitation)
     {
         _inhabitantDevelopment = new DocContentItem("Orbital Habitation", 41);
     }
     else if (level == StarfarerInhabitantDevelopmentLevel.Voidfarers)
     {
         _inhabitantDevelopment = new DocContentItem("Voidfarers", 42);
         for (int i = 0; i < 5; i++)
         {
             ReduceRandomResource(Globals.RollD10(4) + 5);
         }
     }
     else
     {
         throw new Exception("Attempted to set a Starfarers development level that is invalid for this system feature.");
     }
 }
        public void GenerateHumanInhabitants(StarfarerInhabitantDevelopmentLevel forcedLevel = StarfarerInhabitantDevelopmentLevel.Undefined)
        {
            int randValue = Globals.RollD10();

            switch (forcedLevel)
            {
            case StarfarerInhabitantDevelopmentLevel.Undefined:
                break;

            case StarfarerInhabitantDevelopmentLevel.Voidfarers:
                randValue = 10;
                break;

            case StarfarerInhabitantDevelopmentLevel.Colony:
                randValue = 5;
                break;

            case StarfarerInhabitantDevelopmentLevel.OrbitalHabitation:
                randValue = 6;
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(forcedLevel));
            }

            if (randValue <= 2)
            {
                _inhabitantDevelopment = new DocContentItem("Advanced Industry", 40);
                for (int i = 0; i < 3; i++)
                {
                    ReduceRandomResource(Globals.RollD10(3) + 5);
                }
                return;
            }
            if (randValue <= 4)
            {
                if (IsPlanetInhabitable())
                {
                    _inhabitantDevelopment = new DocContentItem("Basic Industry", 41);
                    for (int i = 0; i < 5; i++)
                    {
                        ReduceRandomResource(Globals.RollD10(2) + 5);
                    }
                    return;
                }
            }
            else if (randValue <= 5)
            {
                _inhabitantDevelopment = new DocContentItem("Colony", 41);
                ReduceAllResources(Globals.RollD5());
                return;
            }
            else if (randValue <= 6)
            {
                _inhabitantDevelopment = new DocContentItem("Orbital Habitation", 41);
                return;
            }
            else if (randValue <= 8)
            {
                if (IsPlanetInhabitable())
                {
                    _inhabitantDevelopment = new DocContentItem("Pre-Industrial", 41);
                    int randomNumResources = Globals.Rand.Next(3);
                    for (int i = 0; i < randomNumResources; i++)
                    {
                        ReduceRandomResource(Globals.RollD10() + 5);
                    }
                    return;
                }
            }
            else if (randValue <= 9)
            {
                if (IsPlanetInhabitable())
                {
                    _inhabitantDevelopment = new DocContentItem("Primitive Clans", 42);
                    ReduceRandomResource(Globals.RollD10() + 2);
                    return;
                }
            }
            else
            {
                _inhabitantDevelopment = new DocContentItem("Voidfarers", 42);
                for (int i = 0; i < 5; i++)
                {
                    ReduceRandomResource(Globals.RollD10(4) + 5);
                }
                return;
            }
            GenerateHumanInhabitants();
        }
        public void GenerateXenosOtherInhabitants(StarfarerInhabitantDevelopmentLevel forcedLevel = StarfarerInhabitantDevelopmentLevel.Undefined)
        {
            int randValue = Globals.RollD10();

            switch (forcedLevel)
            {
            case StarfarerInhabitantDevelopmentLevel.Undefined:
                break;

            case StarfarerInhabitantDevelopmentLevel.Voidfarers:
                randValue = 10;
                break;

            case StarfarerInhabitantDevelopmentLevel.Colony:
                randValue = 4;
                break;

            case StarfarerInhabitantDevelopmentLevel.OrbitalHabitation:
                randValue = 5;
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(forcedLevel));
            }

            if (randValue <= 1)
            {
                _inhabitantDevelopment = new DocContentItem("Advanced Industry", 40);
                for (int i = 0; i < 3; i++)
                {
                    ReduceRandomResource(Globals.RollD10(3) + 5);
                }
                return;
            }
            if (randValue <= 3)
            {
                if (IsPlanetInhabitable())
                {
                    _inhabitantDevelopment = new DocContentItem("Basic Industry", 41);
                    for (int i = 0; i < 5; i++)
                    {
                        ReduceRandomResource(Globals.RollD10(2) + 5);
                    }
                    return;
                }
            }
            else if (randValue <= 4)
            {
                _inhabitantDevelopment = new DocContentItem("Colony", 41);
                ReduceAllResources(Globals.RollD5());
                return;
            }
            else if (randValue <= 5)
            {
                _inhabitantDevelopment = new DocContentItem("Orbital Habitation", 41);
                return;
            }
            else if (randValue <= 7)
            {
                if (IsPlanetInhabitable())
                {
                    _inhabitantDevelopment = new DocContentItem("Pre-Industrial", 41);
                    int randomNumResources = Globals.Rand.Next(3);
                    for (int i = 0; i < randomNumResources; i++)
                    {
                        ReduceRandomResource(Globals.RollD10() + 5);
                    }
                    if (Properties.Settings.Default.BookKoronusBestiary)
                    {
                        _primitiveXenosNode.AddXenos(WorldType.TemperateWorld);
                    }
                    return;
                }
            }
            else if (randValue <= 9)
            {
                if (IsPlanetInhabitable())
                {
                    _inhabitantDevelopment = new DocContentItem("Primitive Clans", 42);
                    ReduceRandomResource(Globals.RollD10() + 2);
                    if (Properties.Settings.Default.BookKoronusBestiary)
                    {
                        _primitiveXenosNode.AddXenos(WorldType.TemperateWorld);
                    }
                    return;
                }
            }
            else
            {
                _inhabitantDevelopment = new DocContentItem("Voidfarers", 42);
                for (int i = 0; i < 5; i++)
                {
                    ReduceRandomResource(Globals.RollD10(4) + 5);
                }
                return;
            }
            GenerateXenosOtherInhabitants();
        }