Example #1
0
    private static List <Blueprint> buildBlueprints(Dictionary <Sub, double> subList, System.Random rand)
    {
        List <Sub> keyList = new List <Sub>(subList.Keys);

        List <Blueprint> bl = new List <Blueprint>();

        int numPrints = rand.Next(0, 6);

        for (int i = 0; i < numPrints; i++)
        {
            Sub sub = keyList[rand.Next(0, keyList.Count)];
            bl.Add(RockPrint.buildBlueprint(rand.Next(int.MinValue, int.MaxValue), sub));
        }

        return(bl);
    }
Example #2
0
    /////static method that generates blueprints//
    //TODO: implement static probmeters that generate the probmeters


    public static RockPrint buildBlueprint(int seed, Sub sub)
    {
        System.Random rand = new System.Random(seed);

        //create the size probmeter(will be more complex later)
        double    smallSize = rand.NextDouble() * 4;
        ProbMeter sizeprob  = new ProbMeter(new double[] { smallSize, smallSize + rand.NextDouble() * 4 }, new double[] { 1 });

        //randomly choose if these rocks will be dependent on the substance(most likely)
        bool subDep = rand.NextDouble() < .5;

        //create the amount probmeter
        double    smallAm = rand.NextDouble() * 4;
        ProbMeter amount  = new ProbMeter(new double[] { smallAm, smallAm + rand.NextDouble() * 4 }, new double[] { 1 });


        double    smallDisp = rand.NextDouble();     //*.5f;
        ProbMeter disp      = new ProbMeter(new double[] { smallDisp, smallDisp }, new double[] { 1 });


        RockPrint rp = new RockPrint(sub, sizeprob, subDep, amount, disp);

        return(rp);
    }