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

Merge latets integrated changes #1

Merged
merged 35 commits into from
Sep 16, 2016
Merged
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
44da45e
Slight SimpleJson code tidying
joethephish Jul 9, 2016
f95f37c
Check for null/empty paths, make string components setter private, an…
joethephish Jul 23, 2016
beaf30c
Make Path a bit more immutable by making isRelative's setter private
joethephish Jul 23, 2016
6d4f42b
Don't use ink's internal function calling within choice text producti…
joethephish Jul 25, 2016
1b6254d
Test for temp usage in choices
joethephish Jul 26, 2016
bde59a9
Better support for evaluating arbitrary ink on command line
joethephish Jul 27, 2016
57651aa
Ability to call an ink function from game code
joethephish Aug 3, 2016
1b5f585
Ability to optionally get the text output from EvaluateFunction
joethephish Aug 3, 2016
59d51d2
Document EvaluateFunction
joethephish Aug 3, 2016
b2dfbef
Throw an exception that's caught in play mode when there's an unbound…
joethephish Aug 4, 2016
910313a
Improved version of EvaluateFunction that doesn't clobber the current…
joethephish Aug 4, 2016
1c5b4cd
EvaluateFunction can take ink arguments, and added another Test for it
joethephish Aug 4, 2016
de7e834
Document the EvaluateFunction arguments param
joethephish Aug 4, 2016
1da7428
Oops
joethephish Aug 4, 2016
6c6f349
Add function exists function
tomkail Aug 4, 2016
a9396b7
Add missing semicolon
tomkail Aug 4, 2016
195ccce
Rename function
tomkail Aug 4, 2016
dbcc43c
Replace Debug.Fail instances with simple exception throws, for compat…
joethephish Aug 12, 2016
cff539c
Clone Element's temporaryVariables
cduquesne Aug 21, 2016
8968b6b
Merge pull request #159 from cduquesne/smallfixes
joethephish Aug 21, 2016
a9d1a50
Fix casting issue in TryCoerce function
cduquesne Aug 22, 2016
cfa8af0
Merge pull request #161 from cduquesne/patch-1
joethephish Aug 22, 2016
ea63335
Fix comment that still mentioned Json.net
joethephish Aug 22, 2016
fbee47a
Throw if evaluating a null/empty function
tomkail Aug 22, 2016
285d537
Merge branch 'master' of https://github.com/inkle/ink
tomkail Aug 22, 2016
343f638
Make float.Parse work independent of local culture (so it doesn't exp…
joethephish Sep 6, 2016
b822360
A call to -> END resets the state of "previousContentObject", which a…
joethephish Sep 9, 2016
a064ce4
-> DONE should stop flow in the current thread.
joethephish Sep 11, 2016
fc3b27f
RANDOM and SEED_RANDOM implementations, although not currently produc…
joethephish Sep 11, 2016
532d6ed
Add warning for using "else:" instead of "- else:" within a branch.
joethephish Sep 11, 2016
1998410
Better algorithm for generating a set of consistent set of random num…
joethephish Sep 11, 2016
5d0c19f
Merge branch 'random'
joethephish Sep 11, 2016
6360931
Bah stupid me for pushing before running unit tests. Fixed!
joethephish Sep 11, 2016
d9f7f51
Show error when passing "-> myVar" as a divert target rather than jus…
joethephish Sep 14, 2016
488a3e0
Fix for mismatched left/right glue. I had assumed that only the most …
joethephish Sep 14, 2016
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
Prev Previous commit
Next Next commit
Add function exists function
  • Loading branch information
tomkail committed Aug 4, 2016
commit 6c6f3498caddd58009a566735150b43f57976555
14 changes: 14 additions & 0 deletions ink-engine-runtime/Story.cs
Original file line number Diff line number Diff line change
Expand Up @@ -963,6 +963,20 @@ public void ChooseChoiceIndex(int choiceIdx)
ChoosePath (choiceToChoose.choicePoint.choiceTarget.path);
}

/// <summary>
/// Checks if a function exists.
/// </summary>
/// <returns>True if the function exists, else false.</returns>
/// <param name="functionName">The name of the function as declared in ink.</param>
public bool FunctionExists (string functionName)
{
try {
return ContentAtPath (new Path (functionName)) is Runtime.Container;
} catch (StoryException e) {
return false
}
}

/// <summary>
/// Evaluates a function defined in ink.
/// </summary>
Expand Down