protected override bool PrivateAllow(IScoringGenerator stats, SimDescription sim, SimData settings, AllowCheck check) { if (sim.LotHome == null) { stats.IncStat("Allow: Homeless"); return(false); } if (!settings.GetValue <AllowPersonalityOption, bool>()) { stats.IncStat("Allow: User Denied"); return(false); } SimPersonality personality = stats as SimPersonality; if (personality == null) { IHasPersonality hasPersonality = stats as IHasPersonality; if (hasPersonality != null) { personality = hasPersonality.Personality; } else { Scenario scenario = stats as Scenario; if (scenario != null) { personality = scenario.Manager as SimPersonality; } } } if (personality == null) { Common.DebugStackLog(stats.GetType().ToString()); //stats.IncStat("Allow: Incorrect Manager"); //return false; } else if (settings.HasValue <DisallowPersonalityOption, SimPersonality>(personality)) { stats.IncStat("Allow: Personality Denied"); return(false); } return(true); }