summaryrefslogtreecommitdiff
path: root/scripts/toy.groovy
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2019-07-13 14:12:46 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2019-07-13 14:12:46 +0100
commit2d59e8c3f208b40b3aca6b24015a9108b2125ab0 (patch)
treeaca7c89bf517152078546aa8b1c94e377108feb0 /scripts/toy.groovy
parentRemove gag before cuffs if playSuck called whilst toy is gagged (diff)
downloadtoy-2d59e8c3f208b40b3aca6b24015a9108b2125ab0.zip
Make closures final
Diffstat (limited to 'scripts/toy.groovy')
-rw-r--r--scripts/toy.groovy22
1 files changed, 11 insertions, 11 deletions
diff --git a/scripts/toy.groovy b/scripts/toy.groovy
index 286ffad..85988c7 100644
--- a/scripts/toy.groovy
+++ b/scripts/toy.groovy
@@ -46,7 +46,7 @@ return new Object() {
// Imagery
final DRESSED = "dressed", TITS = "tits", PUSSY = "pussy", LINGERIE = "lingerie", TEASE = "tease", SIT = "sit", BOOTS = "boots", KNEEL = "kneel", STOOD = "stood", MEAN = "mean", CROP = "crop", ASS = "ass", SQUAT = "squat", SSSH = "sssh";
final nDRESSED = "!$DRESSED", nTITS = "!$TITS", nTEASE = "!$TEASE", nKNEEL = "!$KNEEL", nSQUAT = "!$SQUAT";
- def loadDomme = { domme, set = null ->
+ final loadDomme = { domme, set = null ->
final readDomme = { path ->
if (!path) return [:];
final f = new File(path);
@@ -60,7 +60,7 @@ return new Object() {
.collect { readDomme(it) }
.sum()
};
- def loadModules = { toy ->
+ final loadModules = { toy ->
new File("$DATAFOLDER/scripts/toy")
.listFiles()
.collect { s ->
@@ -135,7 +135,7 @@ return new Object() {
void setAway(String a) { save("toy.owner.away", a) }
int randRange(int min, int max) { min + getRandom(1 + max - min) }
int randRange(double min, double max) { randRange((int)min, (int)max) }
- def setDefault = { prop, val ->
+ final setDefault = { prop, val ->
if (loadString(prop) == null) {
save(prop, val);
}
@@ -149,7 +149,7 @@ return new Object() {
int time;
String func;
Object arg;
- def map = {
+ final map = {
[
time: time,
func: func,
@@ -229,7 +229,7 @@ return new Object() {
def sessionAborted = null;
def sessionToys = [:];
- def gagText = { t, p ->
+ final gagText = { t, p ->
if (!stateIs(GAGGED)) return t.toString();
return t.split(/\s+/)
.collect {
@@ -240,16 +240,16 @@ return new Object() {
.join(" ")
.capitalize() + " ($p)";
};
- def showButtonG = { s, p, t = null ->
+ final showButtonG = { s, p, t = null ->
return t != null ? showButton(gagText(s, p), t) : showButton(gagText(s, p));
};
- def compose = { texts ->
+ final compose = { texts ->
if (!texts || texts.isEmpty()) return null;
return texts.collect {
t -> t[getRandom(t.size())]
}.join(" ").capitalize();
};
- def present = { imageSpec, texts ->
+ final present = { imageSpec, texts ->
if (texts) {
show(compose(texts));
}
@@ -258,7 +258,7 @@ return new Object() {
}
return null;
};
- def showButtonGT = { s, p, t, pc ->
+ final showButtonGT = { s, p, t, pc ->
def tt = showButton(gagText(s, p), t);
if (tt == t) {
present(null, [
@@ -292,7 +292,7 @@ return new Object() {
};
// Session
- def sessionSummon = { imageSpec ->
+ final sessionSummon = { imageSpec ->
final limit = 5;
final timeMax = 10;
executeTrigger("toySummoned");
@@ -328,7 +328,7 @@ return new Object() {
executeTrigger("toySummonFail");
return false;
};
- def setSessionAbort = { String r = null -> sessionAborted = r };
+ final setSessionAbort = { String r = null -> sessionAborted = r };
final activityList = [:];
final addActivity = { String name, func, images = [], tags = [] ->