Пример #1
0
    public bool Matches(
		string[] statNames, 
		StatChangeType[] changes, 
		string[] reactableTypes
	)
    {
        bool statNameOK = statNames == null ||
            statNames.Length == 0 ||
            statNames.Contains(effect.statName);
        bool changeOK = changes == null ||
            changes.Length == 0 ||
            changes.Any(delegate(StatChangeType c) {
                switch(c) {
                    case StatChangeType.Any: return true;
                    case StatChangeType.NoChange: return value == initialValue;
                    case StatChangeType.Change: return value != initialValue;
                    case StatChangeType.Increase: return value > initialValue;
                    case StatChangeType.Decrease: return value < initialValue;
                }
                return false;
            });
        bool typesOK = reactableTypes == null ||
            reactableTypes.Length == 0 ||
            reactableTypes.All(t => effect.reactableTypes.Contains(t));
        return statNameOK && changeOK && typesOK;
    }