public static RuleManager GenerateRules(int seed) { var ruleManager = RuleManager.Instance; if (seed == Seed && !_forceRegnerate) { DebugLog("Rule Manager already initialized with seed {0}. Skipping initialization.", seed); return(ruleManager); } _forceRegnerate = false; Seed = seed; CurrentRulesProperty.SetValue(ruleManager, Initialize(seed == int.MinValue ? 0 : seed), null); SeedProperty.SetValue(ruleManager, RuleManager.DEFAULT_SEED, null); return(ruleManager); }
public static void UnloadRuleManager() { SeedProperty.SetValue(RuleManager.Instance, int.MinValue, null); _forceRegnerate = true; }