Skip to content

Commit

Permalink
And more cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
bladecoder committed Oct 16, 2023
1 parent 5b2da13 commit 605955e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/main/java/com/bladecoder/ink/runtime/Container.java
Expand Up @@ -51,7 +51,7 @@ public HashMap<String, RTObject> getNamedOnlyContent() {
}

for (RTObject c : getContent()) {
INamedContent named = c instanceof INamedContent ? (INamedContent) c : (INamedContent) null;
INamedContent named = c instanceof INamedContent ? (INamedContent) c : null;
if (named != null && named.hasValidName()) {
namedOnlyContentDict.remove(named.getName());
}
Expand Down
9 changes: 4 additions & 5 deletions src/main/java/com/bladecoder/ink/runtime/Story.java
Expand Up @@ -139,7 +139,7 @@ protected T3 coerceArg2(Object arg) throws Exception {
}
}

class ExternalFunctionDef {
static class ExternalFunctionDef {
public ExternalFunction<?> function;
public boolean lookaheadSafe;
}
Expand Down Expand Up @@ -186,7 +186,7 @@ public interface VariableObserver {
*/
private boolean allowExternalFunctionFallbacks;

private HashMap<String, ExternalFunctionDef> externals;
private final HashMap<String, ExternalFunctionDef> externals;

private boolean hasValidatedExternals;

Expand All @@ -196,7 +196,7 @@ public interface VariableObserver {

private HashMap<String, List<VariableObserver>> variableObservers;

private List<Container> prevContainers = new ArrayList<>();
private final List<Container> prevContainers = new ArrayList<>();

private Profiler profiler;

Expand Down Expand Up @@ -1594,7 +1594,6 @@ boolean performLogicAndFlowControl(RTObject contentObj) throws Exception {
else if (contentObj instanceof ControlCommand) {
ControlCommand evalCommand = (ControlCommand) contentObj;

int choiceCount;
switch (evalCommand.getCommandType()) {
case EvalStart:
Assert(!state.getInExpressionEvaluation(), "Already in expression evaluation?");
Expand Down Expand Up @@ -1826,7 +1825,7 @@ else if (contentObj instanceof ControlCommand) {
break;
}
case ChoiceCount:
choiceCount = state.getGeneratedChoices().size();
int choiceCount = state.getGeneratedChoices().size();
state.pushEvaluationStack(new IntValue(choiceCount));
break;

Expand Down

0 comments on commit 605955e

Please sign in to comment.