Refactoring the package name

This commit is contained in:
2019-01-26 16:06:13 -05:00
parent ba99ee4608
commit 2b3e55ffb3
17 changed files with 55 additions and 35 deletions

View File

@@ -34,6 +34,7 @@
<!-- haxelib libraries -->
<haxelib>
<!-- example: <library name="..." /> -->
<library name="hank" />
</haxelib>
<!-- Class files to compile (other referenced classes will automatically be included) -->
<compileTargets>

View File

@@ -38,6 +38,7 @@
<!--In case you want to use the addons package-->
<haxelib name="flixel-addons" />
<haxelib name="hank" />
<!--In case you want to use the ui package-->
<!--<haxelib name="flixel-ui" />-->

View File

@@ -9,6 +9,7 @@ import flixel.FlxState;
import flixel.system.FlxAssets;
import flixel.ui.FlxButton;
import flixel.addons.text.FlxTypeText;
import hank.Story;
/**
* A FlxState which can be used for the game's menu.
@@ -17,12 +18,31 @@ class MenuState extends FlxState
{
var _typeText:FlxTypeText;
var _status:FlxTypeText;
var _story:Story;
function revealText() {
if (_typeText != null) {
remove(_typeText);
}
var typeText = "";
while (true) {
var frame = _story.nextFrame();
switch (frame) {
case HasText(text):
typeText += text;
default:
}
}
_typeText = new FlxTypeText(15, 10, FlxG.width - 30, typeText, 16, true);
}
/**
* Function that is called up when to state is created to set it up.
*/
override public function create():Void
{
_story = new Story("assets/scripts/main.hank");
// Set a background color
FlxG.cameras.bgColor = 0xff131c1b;

View File

@@ -1,4 +1,4 @@
package src;
package hank;
enum AltBehavior {
Sequence;

View File

@@ -1,4 +1,4 @@
package src;
package hank;
import haxe.ds.Option;

View File

@@ -1,7 +1,7 @@
package src;
package hank;
import haxe.ds.Option;
import src.Choice.Choice;
import hank.Choice.Choice;
class LineID {
public var sourceFile: String;

View File

@@ -1,4 +1,4 @@
package src;
package hank;
/* This file is cribbed from HaxeFlixel's FlxRandom.hx and FlxMath.hx (MIT License), with modifications by Nat Quayle Nelson for compatibility.

View File

@@ -1,4 +1,4 @@
package src;
package hank;
class RunStoryDemo {
public static function main() {

View File

@@ -1,6 +1,5 @@
package src;
package hank;
import haxe.zip.Compress;
import haxe.ds.Option;
import haxe.io.Bytes;
@@ -10,14 +9,14 @@ import sys.io.FileOutput;
import hscript.Parser;
import hscript.Interp;
import src.HankLines.HankLine;
import src.HankLines.LineID;
import src.HankLines.LineType;
import src.Alt.AltState;
import src.Alt.AltBehavior;
import hank.HankLines.HankLine;
import hank.HankLines.LineID;
import hank.HankLines.LineType;
import hank.Alt.AltState;
import hank.Alt.AltBehavior;
@:allow(tests.StoryTest)
@:allow(src.StoryTestCase)
@:allow(hank.StoryTestCase)
class Story {
private var lineCount: Int = 0;
private var scriptLines: Array<HankLine> = new Array();

View File

@@ -1,4 +1,4 @@
package src;
package hank;
enum StoryFrame {
HasText(text: String);

View File

@@ -1,8 +1,8 @@
package src;
package hank;
import utest.Assert;
import src.StoryFrame;
import src.HankLines.LineID;
import hank.HankLines.LineID;
import hank.StoryFrame;
class StoryTestCase extends utest.Test {
/**

View File

@@ -1,4 +1,4 @@
package src;
package hank;
class Util {
/**

View File

@@ -4,12 +4,11 @@
"license": "MIT",
"tags": ["cross", "game", "interactive-fiction", "ink"],
"description": "Narrative scripting language for HaxeFlixel games based on Inkle's Ink engine",
"version": "0.0.2",
"classPath": "src/",
"version": "0.0.3",
"classPath": "hank/",
"releasenote": "It isn't safe to use this library yet.",
"contributors": ["NQNStudios"],
"dependencies": {
"hx3compat": "",
"hscript": "",
"utest": ""
}

View File

@@ -1,3 +1,3 @@
-lib hscript
-main src.RunStoryDemo
--interp
-main hank.RunStoryDemo
--interp

View File

@@ -1,5 +1,5 @@
-lib hscript
-lib utest
-cp src
-cp hank
-main tests.TestMain
--interp
--interp

View File

@@ -2,9 +2,9 @@ package tests;
import utest.Test;
import utest.Assert;
import src.Alt.AltBehavior;
import src.Alt.AltState;
import src.Random.Random;
import hank.Alt.AltBehavior;
import hank.Alt.AltState;
import hank.Random.Random;
class AltTest extends utest.Test {

View File

@@ -1,13 +1,13 @@
package tests;
import src.Story;
import src.HankLines.HankLine;
import src.HankLines.LineType;
import src.HankLines.LineID;
import src.StoryFrame;
import hank.Story;
import hank.HankLines.HankLine;
import hank.HankLines.LineType;
import hank.HankLines.LineID;
import hank.StoryFrame;
import utest.Assert;
class StoryTest extends src.StoryTestCase {
class StoryTest extends hank.StoryTestCase {
public function testIdEquality() {
var lineID = new LineID('examples/TheIntercept/main.hank', 105);
var lineID2 = new LineID('examples/TheIntercept/main.hank', 105);