use of me.lucko.luckperms.sponge.service.inheritance.SubjectInheritanceGraph in project LuckPerms by lucko.
the class CalculatedSubject method resolveAllOptions.
public void resolveAllOptions(MetaAccumulator accumulator, ImmutableContextSet filter) {
SubjectInheritanceGraph graph = SubjectInheritanceGraphs.getGraph(filter);
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()) {
accumulator.accumulateMeta(entry.getKey(), entry.getValue());
}
}
}
use of me.lucko.luckperms.sponge.service.inheritance.SubjectInheritanceGraph in project LuckPerms by lucko.
the class CalculatedSubject method resolveAllPermissions.
public Map<String, Boolean> resolveAllPermissions(ImmutableContextSet filter) {
SubjectInheritanceGraph graph = SubjectInheritanceGraphs.getGraph(filter);
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(filter).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 resolveAllParents.
public Set<LPSubjectReference> resolveAllParents(ImmutableContextSet filter) {
SubjectInheritanceGraph graph = SubjectInheritanceGraphs.getGraph(filter);
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(filter)) {
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 resolveAllOptions.
public Map<String, String> resolveAllOptions() {
SubjectInheritanceGraph graph = SubjectInheritanceGraphs.getGraph();
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().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 void resolveAllOptions(MetaAccumulator accumulator) {
SubjectInheritanceGraph graph = SubjectInheritanceGraphs.getGraph();
Iterable<CalculatedSubject> traversal = graph.traverse(TraversalAlgorithm.DEPTH_FIRST_PRE_ORDER, this);
for (CalculatedSubject subject : traversal) {
for (Map.Entry<String, String> entry : subject.getCombinedOptions().entrySet()) {
accumulator.accumulateMeta(entry.getKey(), entry.getValue());
}
}
}
Aggregations