using Ariadne.Vellum.UnitTests.Library;
namespace Ariadne.Vellum.UnitTests
{
///
/// Runs a passage of the class it derives from, which is built into another assembly.
///
public partial class VaultSteppingScript : VaultHost
{
public int Stage;
protected override void Run(Vault vault)
{
Stage = 1;
first:
Hold(vault, bonus: 10);
Stage = 2;
}
}
///
/// Uses the value a passage of its base class returns, from another assembly, inside a bigger expression.
///
public partial class VaultCountingScript : VaultHost
{
public int Total;
protected override void Run(Vault vault)
{
count:
Total = 100 + Count(vault);
}
}
///
/// Runs a generic passage of the class it derives from, which is built into another assembly.
///
public partial class VaultWeighingScript : VaultHost
{
protected override void Run(Vault vault)
{
weigh:
Weigh(vault, "ore");
}
}
///
/// Runs a passage of the class it derives from, built into another assembly, that calls itself.
///
public partial class VaultDescendingScript : VaultHost
{
protected override void Run(Vault vault)
{
descend:
Descend(vault, 2);
}
}
///
/// Runs the passages of a generic class that is built into another assembly, one of them generic too.
///
public partial class VaultTaggedScript : VaultTagged
{
protected override void Run(Vault vault)
{
first:
Settle(vault, 3);
second:
Hold(vault, 4, "a");
}
}
///
/// Extends the Run of a class that is built into another assembly, with a local named like the base's.
///
public partial class VaultTemplateScript : VaultTemplate
{
public string Note = "idle";
protected override void Run(Vault vault)
{
string count = "a";
base.Run(vault);
Note = "derived " + count;
}
}
///
/// Runs a passage of an arc that is built into another assembly.
///
public partial class VaultOperator : Arc
{
public VaultPlant Plant;
public string Result;
protected override void Run(Vault vault)
{
int before = 7;
update:
Plant.Update(vault, bonus: 5);
Result = "done " + before;
}
}
///
/// Runs a generic passage of an arc that is built into another assembly.
///
public partial class VaultPonderer : Arc
{
public VaultPlant Plant;
protected override void Run(Vault vault)
{
ponder:
Plant.Ponder(vault, "stone");
}
}
///
/// Runs a passage of an arc that is built into another assembly, which calls itself.
///
public partial class VaultDigger : Arc
{
public VaultPlant Plant;
protected override void Run(Vault vault)
{
dig:
Plant.Dig(vault, 2);
}
}
///
/// Runs passages of a generic arc class that is built into another assembly, one of them generic too.
///
public partial class VaultShopkeeper : Arc
{
public VaultShelf Shelf;
protected override void Run(Vault vault)
{
stock:
Shelf.Stock(vault, "jar");
label:
Shelf.Label(vault, "lid", 5);
}
}
///
/// Uses the value a passage of an arc built into another assembly returns, inside a bigger expression.
///
public partial class VaultMeasurer : Arc
{
public VaultPlant Plant;
public int Total;
protected override void Run(Vault vault)
{
int before = 7;
measure:
Total = before + Plant.Measure(vault);
}
}
}