Ejemplo n.º 1
0
        private static BombRules Initialize(int seed)
        {
            DebugLog("Generating Rules for seed {0}", seed);

            var bombRules = new BombRules
            {
                ManualMetaData = new ManualMetaData
                {
                    BombClassification = ManualMetaData.BOMB_CLASSIFICATION,
                    LockCode           = ManualMetaData.LOCK_CODE
                },
                WireRuleSet         = WireRuleSetGenerator.CreateWireRules(seed),
                WhosOnFirstRuleSet  = (WhosOnFirstRuleSet)WhosOnFirstRuleSetGenerator.GenerateRuleSet(seed),
                MemoryRuleSet       = (MemoryRuleSet)MemoryRuleSetGenerator.GenerateRuleSet(seed),
                KeypadRuleSet       = (KeypadRuleSet)KeypadRuleSetGenerator.GenerateRuleSet(seed),
                NeedyKnobRuleSet    = (NeedyKnobRuleSet)NeedyKnobRuleSetGenerator.GenerateRuleSet(seed),
                ButtonRuleSet       = ButtonRuleSetGenerator.GenerateButtonRules(seed),
                WireSequenceRuleSet = (WireSequenceRuleSet)WireSequenceRuleSetGenerator.GenerateRuleSet(seed),
                PasswordRuleSet     = PasswordRuleSetGenerator.GeneratePasswordRules(seed),
                MorseCodeRuleSet    = MorseCodeRuleSetGenerator.GenerateMorseCodeRuleSet(seed),
                VennWireRuleSet     = VennWireRuleSetGenerator.GenerateVennWireRules(seed),
                RhythmHeavenRuleSet = (RhythmHeavenRuleSet)RhythmHeavenRuleSetGenerator.GenerateRuleSet(seed),
                MazeRuleSet         = (MazeRuleSet)MazeRuleSetGenerator.GenerateRuleSet(seed),
                SimonRuleSet        = SimonRuleSetGenerator.GenerateSimonRuleSet(seed)
            };

            ModRuleSetGenerator.Instance.CreateRules(seed);

            bombRules.PrintRules();
            bombRules.CacheStringValues();

            DebugLog("Done Generating Rules for seed {0}", seed);

            return(bombRules);
        }
Ejemplo n.º 2
0
        private static BombRules Initialize(int seed)
        {
            DebugLog("Generating Rules for seed {0}", seed);
            var rng       = new System.Random(seed);
            var bombRules = new BombRules
            {
                ManualMetaData = new ManualMetaData
                {
                    ManualVersion = OriginalBombRules.ManualMetaData.ManualVersion,
                    //ManualVersion = $"Rule Seed Modifier {OriginalBombRules.ManualMetaData.LanguageCode}-{seed}",
                    Seed         = seed,
                    LockCode     = OriginalBombRules.ManualMetaData.LockCode,
                    LanguageCode = OriginalBombRules.ManualMetaData.LanguageCode,
                    IsValid      = OriginalBombRules.ManualMetaData.IsValid
                },
                WireRuleSet         = WireRuleSetGenerator.CreateWireRules(seed),
                WhosOnFirstRuleSet  = (WhosOnFirstRuleSet)WhosOnFirstRuleSetGenerator.GenerateRuleSet(seed),
                MemoryRuleSet       = (MemoryRuleSet)MemoryRuleSetGenerator.GenerateRuleSet(seed),
                KeypadRuleSet       = (KeypadRuleSet)KeypadRuleSetGenerator.GenerateRuleSet(seed),
                NeedyKnobRuleSet    = (NeedyKnobRuleSet)NeedyKnobRuleSetGenerator.GenerateRuleSet(seed),
                ButtonRuleSet       = ButtonRuleSetGenerator.GenerateButtonRules(seed),
                WireSequenceRuleSet = WireSequenceRuleSetGenerator.GenerateWireSequenceRules(seed),
                PasswordRuleSet     = PasswordRuleSetGenerator.GeneratePasswordRules(seed),
                MorseCodeRuleSet    = MorseCodeRuleSetGenerator.GenerateMorseCodeRuleSet(seed),
                //MorseCodeRuleSet = (MorseCodeRuleSet) MorseCodeRuleSetGenerator.GenerateRuleSet(seed),
                VennWireRuleSet     = VennWireRuleSetGenerator.GenerateVennWireRules(seed),
                RhythmHeavenRuleSet = (RhythmHeavenRuleSet)RhythmHeavenRuleSetGenerator.GenerateRuleSet(seed),
                MazeRuleSet         = (MazeRuleSet)MazeRuleSetGenerator.GenerateRuleSet(seed),
                SimonRuleSet        = SimonRuleSetGenerator.GenerateSimonRuleSet(seed)
            };

            ModRuleSetGenerator.Instance.CreateRules(seed);

            try
            {
                bombRules.CacheStringValues();
            }
            catch (Exception ex)
            {
                DebugLog("Could not Print rules due to Exception: {0}", ex.Message);
                DebugLog(ex.StackTrace);
            }
            PrintRules(bombRules);

            DebugLog("Done Generating Rules for seed {0}", seed);

            return(bombRules);
        }
Ejemplo n.º 3
0
        public BombRules GenerateBombRules(int seed)
        {
            BombRules bombRules = new BombRules
            {
                WireRuleSet         = (WireRuleSet)WireRuleSetGenerator.CreateWireRules(seed),
                WhosOnFirstRuleSet  = (WhosOnFirstRuleSet)WhosOnFirstRuleSetGenerator.GenerateRuleSet(seed),
                MemoryRuleSet       = (MemoryRuleSet)MemoryRuleSetGenerator.GenerateRuleSet(seed),
                KeypadRuleSet       = (KeypadRuleSet)KeypadRuleSetGenerator.GenerateRuleSet(seed),
                NeedyKnobRuleSet    = (NeedyKnobRuleSet)NeedyKnobRuleSetGenerator.GenerateRuleSet(seed),
                ButtonRuleSet       = (ButtonRuleSet)ButtonRuleSetGenerator.GenerateButtonRules(seed),
                WireSequenceRuleSet = (WireSequenceRuleSet)WireSequenceRuleSetGenerator.GenerateRuleSet(seed),
                PasswordRuleSet     = (PasswordRuleSet)PasswordRuleSetGenerator.GeneratePasswordRules(seed),
                MorseCodeRuleSet    = (MorseCodeRuleSet)MorseCodeRuleSetGenerater.GenerateRuleSet(seed),
                VennWireRuleSet     = (VennWireRuleSet)VennWireRuleSetGenerator.GenerateVennWireRules(seed),
                MazeRuleSet         = (MazeRuleSet)MazeRuleSetGenerator.GenerateRuleSet(seed),
                SimonRuleSet        = (SimonRuleSet)SimonRuleSetGenerator.GenerateSimonRuleSet(seed)
            };

            bombRules.CacheStringValues();
            bombRules.PrintRules();
            return(bombRules);
        }