Skip to content

Commit

Permalink
Added xml documentation setting to Release build as well as Debug bui…
Browse files Browse the repository at this point in the history
…ld, which is what we actually ship. Xamarin prints out lots of lovely warnings for documentation you've missed, so finished doing that, and changed protection level for a few things that don't really need to be public (yet). Altered windows build release script to include that xml in the release zip.
  • Loading branch information
joethephish committed Mar 30, 2016
1 parent 25b919c commit eae7f04
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 19 deletions.
2 changes: 1 addition & 1 deletion build_release.command
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ mkdir -p ReleaseBinary

# Windows: Simply zip up inklecate.exe, Newtonsoft.Json.dll and the runtime together
# We rely on a compatible version of .NET being installed on Windows
zip --junk-paths ReleaseBinary/inklecate_windows_and_linux.zip inklecate/bin/Release/Newtonsoft.Json.dll inklecate/bin/Release/inklecate.exe ink-engine-dll/bin/Release/ink-engine.dll
zip --junk-paths ReleaseBinary/inklecate_windows_and_linux.zip inklecate/bin/Release/Newtonsoft.Json.dll inklecate/bin/Release/inklecate.exe ink-engine-dll/bin/Release/ink-engine.dll ink-engine-dll/bin/Release/ink-engine.xml

# Mac: Make a native binary that includes the mono runtime
# Prepare to bundle up compiled binary
Expand Down
4 changes: 2 additions & 2 deletions ink-engine-dll/ink-engine-dll.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Debug\ink-engine.XML</DocumentationFile>
<DocumentationFile>bin\Debug\ink-engine.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Release\ink-engine.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
Expand Down
2 changes: 1 addition & 1 deletion ink-engine-runtime/Choice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class Choice : Runtime.Object
internal string originalChoicePath;


public Choice()
internal Choice()
{
}

Expand Down
10 changes: 5 additions & 5 deletions ink-engine-runtime/DebugMetadata.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
namespace Ink.Runtime
{
public class DebugMetadata
internal class DebugMetadata
{
public int startLineNumber;
public int endLineNumber;
public string fileName;
public string sourceName;
internal int startLineNumber = 0;
internal int endLineNumber = 0;
internal string fileName = null;
internal string sourceName = null;

public DebugMetadata ()
{
Expand Down
22 changes: 17 additions & 5 deletions ink-engine-runtime/Object.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,19 @@

namespace Ink.Runtime
{
/// <summary>
/// Base class for all ink runtime content.
/// </summary>
public /* TODO: abstract */ class Object
{
/// <summary>
/// Runtime.Objects can be included in the main Story as a hierarchy.
/// Usually parents are Container objects. (TODO: Always?)
/// </summary>
/// <value>The parent.</value>
public Runtime.Object parent { get; set; }

public Runtime.DebugMetadata debugMetadata {
internal Runtime.DebugMetadata debugMetadata {
get {
if (_debugMetadata == null) {
if (parent) {
Expand Down Expand Up @@ -181,11 +189,11 @@ internal Container rootContentContainer
}
}

public Object ()
internal Object ()
{
}

protected void SetChild<T>(ref T obj, T value) where T : Runtime.Object
internal void SetChild<T>(ref T obj, T value) where T : Runtime.Object
{
if (obj)
obj.parent = null;
Expand All @@ -196,29 +204,33 @@ public Object ()
obj.parent = this;
}

// Allow implicit conversion to bool so you don't have to do:
// if( myObj != null ) ...
/// Allow implicit conversion to bool so you don't have to do:
/// if( myObj != null ) ...
public static implicit operator bool (Object obj)
{
var isNull = object.ReferenceEquals (obj, null);
return !isNull;
}

/// Required for implicit bool comparison
public static bool operator ==(Object a, Object b)
{
return object.ReferenceEquals (a, b);
}

/// Required for implicit bool comparison
public static bool operator !=(Object a, Object b)
{
return !(a == b);
}

/// Required for implicit bool comparison
public override bool Equals (object obj)
{
return object.ReferenceEquals (obj, this);
}

/// Required for implicit bool comparison
public override int GetHashCode ()
{
return base.GetHashCode ();
Expand Down
17 changes: 12 additions & 5 deletions ink-engine-runtime/Story.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ namespace Ink.Runtime
/// </summary>
public class Story : Runtime.Object
{
/// <summary>
/// The current version of the ink story file format.
/// </summary>
public const int inkVersionCurrent = 11;

// Version numbers are for engine itself and story file, rather
Expand All @@ -27,6 +30,10 @@ public class Story : Runtime.Object
// If possible, you should support it, though it's not as
// critical as loading old save games, since it's an
// in-development problem only.

/// <summary>
/// The minimum legacy version of ink that can be loaded by the current version of the code.
/// </summary>
const int inkVersionMinimumCompatible = 11;

/// <summary>
Expand Down Expand Up @@ -1126,7 +1133,7 @@ public void BindExternalFunction(string funcName, Func<object> func)
/// Bind a C# Action to an ink EXTERNAL function declaration.
/// </summary>
/// <param name="funcName">EXTERNAL ink function name to bind to.</param>
/// <param name="func">The C# function to bind.</param>
/// <param name="act">The C# action to bind.</param>
public void BindExternalFunction(string funcName, Action act)
{
Assert(act != null, "Can't bind a null function");
Expand Down Expand Up @@ -1157,7 +1164,7 @@ public void BindExternalFunction<T>(string funcName, Func<T, object> func)
/// Bind a C# action to an ink EXTERNAL function declaration.
/// </summary>
/// <param name="funcName">EXTERNAL ink function name to bind to.</param>
/// <param name="func">The C# function to bind.</param>
/// <param name="act">The C# action to bind.</param>
public void BindExternalFunction<T>(string funcName, Action<T> act)
{
Assert(act != null, "Can't bind a null function");
Expand Down Expand Up @@ -1192,7 +1199,7 @@ public void BindExternalFunction<T>(string funcName, Action<T> act)
/// Bind a C# action to an ink EXTERNAL function declaration.
/// </summary>
/// <param name="funcName">EXTERNAL ink function name to bind to.</param>
/// <param name="func">The C# function to bind.</param>
/// <param name="act">The C# action to bind.</param>
public void BindExternalFunction<T1, T2>(string funcName, Action<T1, T2> act)
{
Assert(act != null, "Can't bind a null function");
Expand Down Expand Up @@ -1230,7 +1237,7 @@ public void BindExternalFunction<T>(string funcName, Action<T> act)
/// Bind a C# action to an ink EXTERNAL function declaration.
/// </summary>
/// <param name="funcName">EXTERNAL ink function name to bind to.</param>
/// <param name="func">The C# function to bind.</param>
/// <param name="act">The C# action to bind.</param>
public void BindExternalFunction<T1, T2, T3>(string funcName, Action<T1, T2, T3> act)
{
Assert(act != null, "Can't bind a null function");
Expand Down Expand Up @@ -1392,7 +1399,7 @@ void VariableStateDidChangeEvent(string variableName, Runtime.Object newValueObj

/// <summary>
/// Useful when debugging a (very short) story, to visualise the state of the
/// story. Add this call as a watch and open the extended text. A "<--" mark
/// story. Add this call as a watch and open the extended text. A left-arrow mark
/// will denote the current point of the story.
/// It's only recommended that this is used on very short debug stories, since
/// it can end up generate a large quantity of text otherwise.
Expand Down
10 changes: 10 additions & 0 deletions ink-engine-runtime/StoryState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,18 @@

namespace Ink.Runtime
{
/// <summary>
/// All story state information is included in the StoryState class,
/// including global variables, read counts, the pointer to the current
/// point in the story, the call stack (for tunnels, functions, etc),
/// and a few other smaller bits and pieces. You can save the current
/// state using the json serialisation functions ToJson and LoadJson.
/// </summary>
public class StoryState
{
/// <summary>
/// The current version of the state save file JSON-based format.
/// </summary>
public const int kInkSaveStateVersion = 2;
const int kMinCompatibleLoadVersion = 2;

Expand Down
5 changes: 5 additions & 0 deletions ink-engine-runtime/VariablesState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@

namespace Ink.Runtime
{
/// <summary>
/// Encompasses all the global variables in an ink Story, and
/// allows binding of a VariableChanged event so that that game
/// code can be notified whenever the global variables change.
/// </summary>
public class VariablesState : IEnumerable<string>
{
internal delegate void VariableChanged(string variableName, Runtime.Object newValue);
Expand Down

0 comments on commit eae7f04

Please sign in to comment.