Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always fully qualify ink runtime #59

Merged
merged 2 commits into from
Aug 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ csharp_style_expression_bodied_local_functions = when_on_single_line
csharp_style_expression_bodied_methods = false

# Analyzers
dotnet_analyzer_diagnostic.severity = suggestion

dotnet_diagnostic.IDE0001.severity = suggestion # Name can be simplified.
dotnet_diagnostic.IDE0005.severity = warning # Unused using directives.
Expand All @@ -86,7 +85,6 @@ dotnet_diagnostic.IDE0010.severity = silent # Incomplete switch statements.
dotnet_diagnostic.IDE0072.severity = silent # ^ Ditto.
dotnet_diagnostic.IDE0022.severity = warning # Use of expression body for methods.
dotnet_diagnostic.IDE0046.severity = silent # Use conditional expression for return.
dotnet_diagnostic.IDE0055.severity = silent # Formatting rule.
dotnet_diagnostic.IDE0059.severity = warning # Useless assignation.
dotnet_diagnostic.IDE1006.severity = default # Naming rule.
dotnet_diagnostic.CA1710.severity = silent # Meaningful names.
Expand Down
7 changes: 3 additions & 4 deletions addons/GodotInk/Src/InkChoice.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#nullable enable

using Godot;
using Ink.Runtime;
using System.Collections.Generic;

namespace GodotInk;
Expand All @@ -17,14 +16,14 @@ public partial class InkChoice : GodotObject
public int Index => inner.index;
public List<string> Tags => inner.tags;

private readonly Choice inner;
private readonly Ink.Runtime.Choice inner;

private InkChoice()
{
inner = new Choice();
inner = new Ink.Runtime.Choice();
}

public InkChoice(Choice inner)
public InkChoice(Ink.Runtime.Choice inner)
{
this.inner = inner;
}
Expand Down
13 changes: 6 additions & 7 deletions addons/GodotInk/Src/InkStory.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#nullable enable

using Godot;
using Ink.Runtime;
using System;
using System.Collections.Generic;

Expand Down Expand Up @@ -38,10 +37,10 @@ protected virtual string RawStory
}

private string rawStory = string.Empty;
private Story runtimeStory = null!;
private Ink.Runtime.Story runtimeStory = null!;

private readonly Dictionary<string, HashSet<Callable>> observers = new();
private readonly Dictionary<string, Story.VariableObserver> internalObservers = new();
private readonly Dictionary<string, Ink.Runtime.Story.VariableObserver> internalObservers = new();

public static InkStory Create(string rawStory)
{
Expand All @@ -59,7 +58,7 @@ private void InitializeRuntimeStory()
runtimeStory.onMakeChoice -= OnMadeChoice;
}

runtimeStory = new Story(rawStory);
runtimeStory = new Ink.Runtime.Story(rawStory);

runtimeStory.onDidContinue += OnContinued;
runtimeStory.onMakeChoice += OnMadeChoice;
Expand Down Expand Up @@ -229,7 +228,7 @@ public void ObserveVariable(string variableName, Callable observer)
{
if (!internalObservers.ContainsKey(variableName))
{
Story.VariableObserver internalObserver = BuildObserver();
Ink.Runtime.Story.VariableObserver internalObserver = BuildObserver();
runtimeStory.ObserveVariable(variableName, internalObserver);
internalObservers[variableName] = internalObserver;
}
Expand All @@ -251,7 +250,7 @@ public void ObserveVariable(string[] variableNames, Callable observer)
ObserveVariable(variableName, observer);
}

private Story.VariableObserver BuildObserver()
private Ink.Runtime.Story.VariableObserver BuildObserver()
{
return delegate (string name, object? value)
{
Expand Down Expand Up @@ -677,7 +676,7 @@ private void OnContinued()
_ = EmitSignal(SignalName.Continued);
}

private void OnMadeChoice(Choice choice)
private void OnMadeChoice(Ink.Runtime.Choice choice)
{
_ = EmitSignal(SignalName.MadeChoice, new InkChoice(choice));
}
Expand Down