use of me.lucko.luckperms.sponge.service.inheritance.SubjectInheritanceGraph in project LuckPerms by lucko.
the class CalculatedSubject method resolveAllParents.
public Set<LPSubjectReference> resolveAllParents() {
SubjectInheritanceGraph graph = SubjectInheritanceGraphs.getGraph();
Set<LPSubjectReference> result = new LinkedHashSet<>();
Iterable<CalculatedSubject> traversal = graph.traverse(TraversalAlgorithm.DEPTH_FIRST_PRE_ORDER, this);
for (CalculatedSubject subject : traversal) {
for (LPSubjectReference entry : subject.getCombinedParents()) {
if (!result.contains(entry)) {
result.add(entry);
}
}
}
return result;
}
use of me.lucko.luckperms.sponge.service.inheritance.SubjectInheritanceGraph in project LuckPerms by lucko.
the class CalculatedSubject method resolveAllPermissions.
public Map<String, Boolean> resolveAllPermissions() {
SubjectInheritanceGraph graph = SubjectInheritanceGraphs.getGraph();
Map<String, Boolean> result = new HashMap<>();
Iterable<CalculatedSubject> traversal = graph.traverse(TraversalAlgorithm.DEPTH_FIRST_PRE_ORDER, this);
for (CalculatedSubject subject : traversal) {
for (Map.Entry<String, Boolean> entry : subject.getCombinedPermissions().entrySet()) {
result.putIfAbsent(entry.getKey(), entry.getValue());
}
}
return result;
}
use of me.lucko.luckperms.sponge.service.inheritance.SubjectInheritanceGraph in project LuckPerms by lucko.
the class CalculatedSubject method resolveAllOptions.
public Map<String, String> resolveAllOptions(ImmutableContextSet filter) {
SubjectInheritanceGraph graph = SubjectInheritanceGraphs.getGraph(filter);
Map<String, String> result = new HashMap<>();
Iterable<CalculatedSubject> traversal = graph.traverse(TraversalAlgorithm.DEPTH_FIRST_PRE_ORDER, this);
for (CalculatedSubject subject : traversal) {
for (Map.Entry<String, String> entry : subject.getCombinedOptions(filter).entrySet()) {
result.putIfAbsent(entry.getKey(), entry.getValue());
}
}
return result;
}
Aggregations