Beispiel #1
0
    void setupRuleSeed()
    {
        var rnd = RuleSeedable.GetRNG();

        if (rnd.Seed == 1)
        {
            one = new int[10] {
                0, 1, 2, 3, 4, 5, 6, 7, 8, 9
            };
            two = new int[10] {
                10, 0, 6, 11, 12, 13, 14, 15, 16, 17
            };
            three = new int[10] {
                18, 17, 11, 13, 2, 8, 1, 10, 19, 9
            };
            four = new int[10] {
                19, 15, 18, 1, 4, 11, 0, 7, 17, 20
            };
            five = new int[10] {
                13, 11, 4, 12, 20, 16, 5, 0, 14, 8
            };
            batteriesNeeded = 2; //more than
            firstNeeded     = ports[1];
            secondNeeded    = ports[0];
        }
        else
        {
            var options        = new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 };
            var batteryOptions = new int[4] {
                1, 2, 3, 4
            };
            var rowOptions = new int[5] {
                0, 1, 2, 3, 4
            };
            var rows = new int[][] { new int[10], new int[10], new int[10], new int[10], new int[10] };

            options.Shuffle(rnd);
            batteryOptions.Shuffle(rnd);
            ports.Shuffle(rnd);
            rowOptions.Shuffle(rnd);

            rows[0] = new int[10] {
                options[0], options[1], options[2], options[3], options[4], options[5], options[6], options[7], options[8], options[9]
            };
            rows[1] = new int[10] {
                options[10], options[11], options[12], options[13], options[14], options[15], options[16], options[17], options[18], options[19]
            };
            rows[2] = new int[10] {
                options[20], options[2], options[4], options[6], options[8], options[10], options[12], options[14], options[16], options[18]
            };
            rows[3] = new int[10] {
                options[1], options[3], options[5], options[7], options[9], options[11], options[13], options[15], options[17], options[19]
            };
            rows[4] = new int[10] {
                options[19], options[7], options[4], options[0], options[9], options[13], options[12], options[20], options[16], options[1]
            };

            one   = rows[rowOptions[0]];
            two   = rows[rowOptions[1]];
            three = rows[rowOptions[2]];
            four  = rows[rowOptions[3]];
            five  = rows[rowOptions[4]];

            batteriesNeeded = batteryOptions[0];
            firstNeeded     = ports[2];
            secondNeeded    = ports[3];
        }
    }
 private bool HasPortType(KMBombInfoExtensions.KnownPortType type)
 {
     return(this.kmBombInfo.GetPortCount(type) > 0);
 }