From 9c5c2c01e7053533e0449592e5ac3d4c7173a341 Mon Sep 17 00:00:00 2001 From: Vassyli Date: Thu, 29 Jun 2017 09:48:31 +0200 Subject: [PATCH] Adds continuation scene. --- composer.lock | 111 +++++++++++++++++++++++++------------------------ src/Module.php | 20 ++++++--- 2 files changed, 71 insertions(+), 60 deletions(-) diff --git a/composer.lock b/composer.lock index fec880d..d0a679b 100644 --- a/composer.lock +++ b/composer.lock @@ -4,6 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], + "hash": "02ae5d3e218a5455246b60be6f6e254a", "content-hash": "3371739265045479517db432a9814075", "packages": [ { @@ -48,7 +49,7 @@ "slug", "transliterator" ], - "time": "2017-04-04T11:38:05+00:00" + "time": "2017-04-04 11:38:05" }, { "name": "composer/ca-bundle", @@ -107,7 +108,7 @@ "ssl", "tls" ], - "time": "2017-03-06T11:59:08+00:00" + "time": "2017-03-06 11:59:08" }, { "name": "composer/composer", @@ -184,7 +185,7 @@ "dependency", "package" ], - "time": "2017-05-17T06:17:53+00:00" + "time": "2017-05-17 06:17:53" }, { "name": "composer/semver", @@ -246,7 +247,7 @@ "validation", "versioning" ], - "time": "2016-08-30T16:08:34+00:00" + "time": "2016-08-30 16:08:34" }, { "name": "composer/spdx-licenses", @@ -307,7 +308,7 @@ "spdx", "validator" ], - "time": "2017-04-03T19:08:52+00:00" + "time": "2017-04-03 19:08:52" }, { "name": "d11wtq/boris", @@ -343,7 +344,7 @@ "MIT" ], "description": "A tiny, but robust REPL (Read-Evaluate-Print-Loop) for PHP.", - "time": "2015-03-01T08:05:19+00:00" + "time": "2015-03-01 08:05:19" }, { "name": "doctrine/annotations", @@ -411,7 +412,7 @@ "docblock", "parser" ], - "time": "2017-02-24T16:22:25+00:00" + "time": "2017-02-24 16:22:25" }, { "name": "doctrine/cache", @@ -481,7 +482,7 @@ "cache", "caching" ], - "time": "2016-10-29T11:16:17+00:00" + "time": "2016-10-29 11:16:17" }, { "name": "doctrine/collections", @@ -548,7 +549,7 @@ "collections", "iterator" ], - "time": "2017-01-03T10:49:41+00:00" + "time": "2017-01-03 10:49:41" }, { "name": "doctrine/common", @@ -621,7 +622,7 @@ "persistence", "spl" ], - "time": "2017-01-13T14:02:13+00:00" + "time": "2017-01-13 14:02:13" }, { "name": "doctrine/dbal", @@ -692,7 +693,7 @@ "persistence", "queryobject" ], - "time": "2017-02-08T12:53:47+00:00" + "time": "2017-02-08 12:53:47" }, { "name": "doctrine/inflector", @@ -759,7 +760,7 @@ "singularize", "string" ], - "time": "2015-11-06T14:35:42+00:00" + "time": "2015-11-06 14:35:42" }, { "name": "doctrine/instantiator", @@ -813,7 +814,7 @@ "constructor", "instantiate" ], - "time": "2015-06-14T21:17:01+00:00" + "time": "2015-06-14 21:17:01" }, { "name": "doctrine/lexer", @@ -867,7 +868,7 @@ "lexer", "parser" ], - "time": "2014-09-09T13:34:57+00:00" + "time": "2014-09-09 13:34:57" }, { "name": "doctrine/orm", @@ -943,7 +944,7 @@ "database", "orm" ], - "time": "2016-12-18T15:42:34+00:00" + "time": "2016-12-18 15:42:34" }, { "name": "gedmo/doctrine-extensions", @@ -1021,7 +1022,7 @@ "tree", "uploadable" ], - "time": "2017-05-29T17:33:48+00:00" + "time": "2017-05-29 17:33:48" }, { "name": "justinrainbow/json-schema", @@ -1088,7 +1089,7 @@ "json", "schema" ], - "time": "2017-05-16T21:06:09+00:00" + "time": "2017-05-16 21:06:09" }, { "name": "lotgd/core", @@ -1137,7 +1138,7 @@ "source": "https://github.com/lotgd/core/tree/v0.3.1-alpha", "issues": "https://github.com/lotgd/core/issues" }, - "time": "2017-06-23T12:43:24+00:00" + "time": "2017-06-23 12:43:24" }, { "name": "lotgd/module-village", @@ -1183,7 +1184,7 @@ "source": "https://github.com/lotgd/module-village/tree/v0.3.1-alpha", "issues": "https://github.com/lotgd/module-village/issues" }, - "time": "2017-04-30T12:56:29+00:00" + "time": "2017-04-30 12:56:29" }, { "name": "monolog/monolog", @@ -1261,7 +1262,7 @@ "logging", "psr-3" ], - "time": "2017-06-19T01:22:40+00:00" + "time": "2017-06-19 01:22:40" }, { "name": "psr/log", @@ -1308,7 +1309,7 @@ "psr", "psr-3" ], - "time": "2016-10-10T12:19:37+00:00" + "time": "2016-10-10 12:19:37" }, { "name": "seld/cli-prompt", @@ -1356,7 +1357,7 @@ "input", "prompt" ], - "time": "2017-03-18T11:32:45+00:00" + "time": "2017-03-18 11:32:45" }, { "name": "seld/jsonlint", @@ -1405,7 +1406,7 @@ "parser", "validator" ], - "time": "2017-06-18T15:11:04+00:00" + "time": "2017-06-18 15:11:04" }, { "name": "seld/phar-utils", @@ -1449,7 +1450,7 @@ "keywords": [ "phra" ], - "time": "2015-10-13T18:44:15+00:00" + "time": "2015-10-13 18:44:15" }, { "name": "symfony/console", @@ -1518,7 +1519,7 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2017-06-02T19:24:58+00:00" + "time": "2017-06-02 19:24:58" }, { "name": "symfony/debug", @@ -1574,7 +1575,7 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2017-06-01T21:01:25+00:00" + "time": "2017-06-01 21:01:25" }, { "name": "symfony/filesystem", @@ -1623,7 +1624,7 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2017-05-28T14:08:56+00:00" + "time": "2017-05-28 14:08:56" }, { "name": "symfony/finder", @@ -1672,7 +1673,7 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2017-06-01T21:01:25+00:00" + "time": "2017-06-01 21:01:25" }, { "name": "symfony/polyfill-mbstring", @@ -1731,7 +1732,7 @@ "portable", "shim" ], - "time": "2017-06-09T14:24:12+00:00" + "time": "2017-06-09 14:24:12" }, { "name": "symfony/process", @@ -1780,7 +1781,7 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2017-05-22T12:32:03+00:00" + "time": "2017-05-22 12:32:03" }, { "name": "symfony/yaml", @@ -1835,7 +1836,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2017-06-02T22:05:06+00:00" + "time": "2017-06-02 22:05:06" } ], "packages-dev": [ @@ -1879,7 +1880,7 @@ "object", "object graph" ], - "time": "2017-04-12T18:52:22+00:00" + "time": "2017-04-12 18:52:22" }, { "name": "phpdocumentor/reflection-common", @@ -1933,7 +1934,7 @@ "reflection", "static analysis" ], - "time": "2015-12-27T11:43:31+00:00" + "time": "2015-12-27 11:43:31" }, { "name": "phpdocumentor/reflection-docblock", @@ -1978,7 +1979,7 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2016-09-30T07:12:33+00:00" + "time": "2016-09-30 07:12:33" }, { "name": "phpdocumentor/type-resolver", @@ -2025,7 +2026,7 @@ "email": "me@mikevanriel.com" } ], - "time": "2016-11-25T06:54:22+00:00" + "time": "2016-11-25 06:54:22" }, { "name": "phpspec/prophecy", @@ -2088,7 +2089,7 @@ "spy", "stub" ], - "time": "2017-03-02T20:05:34+00:00" + "time": "2017-03-02 20:05:34" }, { "name": "phpunit/dbunit", @@ -2143,7 +2144,7 @@ "testing", "xunit" ], - "time": "2016-12-02T14:39:14+00:00" + "time": "2016-12-02 14:39:14" }, { "name": "phpunit/php-code-coverage", @@ -2206,7 +2207,7 @@ "testing", "xunit" ], - "time": "2017-04-02T07:44:40+00:00" + "time": "2017-04-02 07:44:40" }, { "name": "phpunit/php-file-iterator", @@ -2253,7 +2254,7 @@ "filesystem", "iterator" ], - "time": "2016-10-03T07:40:28+00:00" + "time": "2016-10-03 07:40:28" }, { "name": "phpunit/php-text-template", @@ -2294,7 +2295,7 @@ "keywords": [ "template" ], - "time": "2015-06-21T13:50:34+00:00" + "time": "2015-06-21 13:50:34" }, { "name": "phpunit/php-timer", @@ -2343,7 +2344,7 @@ "keywords": [ "timer" ], - "time": "2017-02-26T11:10:40+00:00" + "time": "2017-02-26 11:10:40" }, { "name": "phpunit/php-token-stream", @@ -2392,7 +2393,7 @@ "keywords": [ "tokenizer" ], - "time": "2017-02-27T10:12:30+00:00" + "time": "2017-02-27 10:12:30" }, { "name": "phpunit/phpunit", @@ -2474,7 +2475,7 @@ "testing", "xunit" ], - "time": "2017-06-21T08:11:54+00:00" + "time": "2017-06-21 08:11:54" }, { "name": "phpunit/phpunit-mock-objects", @@ -2533,7 +2534,7 @@ "mock", "xunit" ], - "time": "2016-12-08T20:27:08+00:00" + "time": "2016-12-08 20:27:08" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -2578,7 +2579,7 @@ ], "description": "Looks up which function or method a line of code belongs to", "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "time": "2017-03-04T06:30:41+00:00" + "time": "2017-03-04 06:30:41" }, { "name": "sebastian/comparator", @@ -2642,7 +2643,7 @@ "compare", "equality" ], - "time": "2017-01-29T09:50:25+00:00" + "time": "2017-01-29 09:50:25" }, { "name": "sebastian/diff", @@ -2694,7 +2695,7 @@ "keywords": [ "diff" ], - "time": "2017-05-22T07:24:03+00:00" + "time": "2017-05-22 07:24:03" }, { "name": "sebastian/environment", @@ -2744,7 +2745,7 @@ "environment", "hhvm" ], - "time": "2016-11-26T07:53:53+00:00" + "time": "2016-11-26 07:53:53" }, { "name": "sebastian/exporter", @@ -2811,7 +2812,7 @@ "export", "exporter" ], - "time": "2016-11-19T08:54:04+00:00" + "time": "2016-11-19 08:54:04" }, { "name": "sebastian/global-state", @@ -2862,7 +2863,7 @@ "keywords": [ "global state" ], - "time": "2015-10-12T03:26:01+00:00" + "time": "2015-10-12 03:26:01" }, { "name": "sebastian/object-enumerator", @@ -2908,7 +2909,7 @@ ], "description": "Traverses array structures and object graphs to enumerate all referenced objects", "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "time": "2017-02-18T15:18:39+00:00" + "time": "2017-02-18 15:18:39" }, { "name": "sebastian/recursion-context", @@ -2961,7 +2962,7 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2016-11-19T07:33:16+00:00" + "time": "2016-11-19 07:33:16" }, { "name": "sebastian/resource-operations", @@ -3003,7 +3004,7 @@ ], "description": "Provides a list of PHP built-in functions that operate on resources", "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "time": "2015-07-28T20:34:47+00:00" + "time": "2015-07-28 20:34:47" }, { "name": "sebastian/version", @@ -3046,7 +3047,7 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", - "time": "2016-10-03T07:35:21+00:00" + "time": "2016-10-03 07:35:21" }, { "name": "webmozart/assert", @@ -3096,7 +3097,7 @@ "check", "validate" ], - "time": "2016-11-23T20:04:58+00:00" + "time": "2016-11-23 20:04:58" } ], "aliases": [], diff --git a/src/Module.php b/src/Module.php index fed5809..39afff8 100644 --- a/src/Module.php +++ b/src/Module.php @@ -144,15 +144,17 @@ public static function onRegister(Game $g, ModuleModel $module) $sceneIds = $module->getProperty(self::ModulePropertySceneId); if ($sceneIds === null) { - [$newDayScene, $restorationScene] = self::getScenes(); + [$newDayScene, $restorationScene, $continueScene] = self::getScenes(); $g->getEntityManager()->persist($newDayScene); $g->getEntityManager()->persist($restorationScene); + $g->getEntityManager()->persist($continueScene); $g->getEntityManager()->flush(); $module->setProperty(self::ModulePropertySceneId, [ self::SceneNewDay => $newDayScene->getId(), - self::SceneRestoration => $restorationScene->getId() + self::SceneRestoration => $restorationScene->getId(), + self::SceneContinue => $continueScene->getId() ]); // logging @@ -160,7 +162,8 @@ public static function onRegister(Game $g, ModuleModel $module) "%s: Adds scenes (newday: %s, restoration: %s)", self::Module, $newDayScene->getId(), - $restorationScene->getId() + $restorationScene->getId(), + $continueScene->getId() )); } } @@ -174,6 +177,7 @@ public static function onUnregister(Game $g, ModuleModel $module) // delete village $g->getEntityManager()->getRepository(Scene::class)->find($sceneIds[self::SceneNewDay])->delete($g->getEntityManager()); $g->getEntityManager()->getRepository(Scene::class)->find($sceneIds[self::SceneRestoration])->delete($g->getEntityManager()); + $g->getEntityManager()->getRepository(Scene::class)->find($sceneIds[self::SceneContinue])->delete($g->getEntityManager()); // set property to null $module->setProperty(self::ModulePropertySceneId, null); @@ -191,12 +195,18 @@ protected static function getScenes(): array $restorationScene = Scene::create([ "template" => self::SceneRestoration, + "title" => "Restoration", + "description" => "You should not be able to see this text if everything works, this scene should restore your viewpoint." + ]); + + $continueScene = Scene::create([ + "template" => self::SceneContinue, "title" => "Continue", - "description" => "You should not be able to see this text if everything works." + "description" => "You should not be able to see this text if everything works, this is for internal work only." ]); $newDayScene->connect($restorationScene, Scene::Unidirectional); - return [$newDayScene, $restorationScene]; + return [$newDayScene, $restorationScene, $continueScene]; } }