Commit Graph

110 Commits

Author SHA1 Message Date
Vassyli 498f4965e6 Adds tests and support for Unidirectional connections.
Also fixes travis config.
2017-03-02 20:04:27 +01:00
Vassyli 2970bd09d7 Changed the scene parent<=>child relationship to connections.
The parent<=>child relationship of scenes was removed. Instead, this commit introduces the concept of a connection.

A connection is used to connect two scenes. Depending on which entity the connect-method is called, one is defined as the "outgoing" scene, the other as the ingoing scene:

```
$a->connect($b);
```

In this case, $a will be the outgoing part of the connection, $b the incoming.

Furthermore, in order to support action groups, this commit introduces SceneConnectionGroups which can be created in scenes and checked wether they exist or not. Using these, it is possible to specifiy to which part of the scenes are connected to each other.

```
$a->getConnectionGroup("scene-A/marketsquare")->connect($b);
```

In this case, $a will have the action to access $b under the ActionGroup of scene-A/marketsquare. On the other hand, $b, which doesn't have a connection group specified, will have the connection back to $a in the default group.

Connect also accepts the return value of getConnectionGroup as the argument, thus allowing the connection _to_ a certain part of $b as well:

```
$a->connect($b->getConnectionGroup("scene-B/back"));
```

The tests for scenes were updates in order to reflect this change.
2017-03-02 17:19:46 +01:00
Vassyli e82e72a183 Abstract actor model has more straightforward API
The implicit API requirements via class properties has been changed to relay now on abstract methods that the extending class must implement.
2017-01-19 10:18:27 +01:00
Vassyli 9ecd0ddc58 Applied suggested changes 2017-01-19 10:02:31 +01:00
Vassyli 64cb22d3c0 Replaced Permissionable/-Interface with an abstract Actor class. 2017-01-19 10:02:31 +01:00
Vassyli f8057077bc Adds logging to permission manager and requires an actor to return an actor name. 2017-01-19 10:02:31 +01:00
Vassyli 1c89d8f204 Adds removal of exceptions as well as error handling. 2017-01-19 10:02:31 +01:00
Vassyli 3b8537fab6 Adds methods to read and check permissions. 2017-01-19 10:02:31 +01:00
Vassyli 3bf23f3ac7 Adds Permission model and framework for testing permission manager. 2017-01-19 10:02:31 +01:00
Basilius Sauter 94e18b8d11 Increases windows compability by removing microtime from tests 2017-01-04 08:26:10 +01:00
Basilius Sauter b8f47c6d53 Fixed composer creation to account completely for cwd
Also added tests that fail if not.
2017-01-04 08:23:32 +01:00
Austen McDonald e041db89bc Add Viewpoint::removeActionsWithSceneId for easier writing of scenes without default nav items 2016-12-31 14:00:30 -08:00
Austen McDonald 340d6d18fa Rename CharacterViewpoint to Viewpoint
As I was writing the documentation, this just feels like added complexity that we don't need.
2016-11-11 14:06:26 -08:00
Austen McDonald 4c5e1429b6 Build support for multiple parents (graph of scenes instead of tree) 2016-10-31 09:22:31 -07:00
Austen McDonald be543bb630 Add addActionToGroupId 2016-09-17 06:14:03 +00:00
Austen McDonald 798490fe20 Add findActionGroupById 2016-09-17 06:01:18 +00:00
Austen McDonald faf699eb3f Remove extra whitespace in CharacterModelTest 2016-09-16 05:26:36 +00:00
Austen McDonald 4d61bbd348 Make properties cascade=remove for Character and Module 2016-09-16 05:26:19 +00:00
Austen McDonald f7e34162e8 Rename CharacterViewpoint::getActions() to CharacterViewpoint::getActionGroups() b/c that's what it is 2016-09-04 06:08:00 +00:00
Austen McDonald f73c5c3b11 Fix GameTest to use new hook and fix a bug in it :) 2016-09-04 06:03:07 +00:00
Austen McDonald c585dcb33a Fix bug in Scene constructor 2016-08-30 20:40:09 +00:00
Austen McDonald 135dd22939 Add tests for simple getters in Game and fix bug with TimeKeeper 2016-08-23 22:33:46 +00:00
Austen McDonald 86751fc6d5 Refactor ModelTestCase so I can use it outside of the Core. 2016-08-22 14:30:22 -07:00
Austen McDonald 271ffc8b5e Add getModule() call to ModuleManager 2016-08-21 03:58:35 +00:00
Austen McDonald f0a7b0b42e Pass module model into onRegister/onUnregister 2016-08-21 03:58:35 +00:00
Austen McDonald ccf51450b0 Add property support for modules. 2016-08-21 03:58:35 +00:00
Vassyli cbcc606025 Adds a few test for Configuration
Adds a bunch of tests testing if InvalidConfigurationException is thrown as expected.
2016-08-12 08:24:43 +02:00
Austen McDonald 87c45f1fae Add simple tests for Actions and Attachments 2016-08-11 15:39:26 +00:00
Vassyli 0fecb32b57 Adds tailing dir seperator to %cwd% and adds tests 2016-08-11 12:05:18 +02:00
Vassyli 4e1fe65619 Moved %cwd% parsing to configuration and added test 2016-08-11 11:50:00 +02:00
Austen McDonald 921eb282a4 Add cwd or rootDir support back to the game so crates can configure where their composer root will live 2016-08-09 20:12:34 -07:00
Austen McDonald b360ca9ac6 Remove support for LOTGD_CONFIG environment variable. 2016-08-09 00:49:20 -07:00
Austen McDonald 9f698239b4 Add the ability to set a cwd on game creation 2016-08-09 00:42:45 -07:00
Austen McDonald 88cafacddb Refactor BootConfiguration into LibraryConfiguration and read all configuration for modules from it 2016-08-08 23:11:57 -07:00
Austen McDonald 05d14c8ba3 Refactor handleEvent() to pass in the Game always. 2016-08-02 21:28:19 +00:00
Austen McDonald d82f3fc588 Change hook for setting up viewpoint to handle all actions, data and attachments 2016-08-02 20:11:36 +00:00
Austen McDonald 36c57cf9cb Refactor the method to be get/setViewpoint() instead of get/setCharacterViewpoint for simplicity 2016-08-01 21:28:01 +00:00
Austen McDonald 6c8c12758f Add additional tests for Game and fix bugs 2016-08-01 10:04:35 +00:00
Austen McDonald a2fb425632 Fix bugs in Game and add some tests 2016-08-01 06:58:00 +00:00
Austen McDonald 3c3f5c970c Change Character to no longer handle creating its own CharacterViewpoint if it's empty 2016-08-01 06:57:59 +00:00
Austen McDonald 1d24aa973f Change EventHandler to always pass by reference and kill return-value semantics. 2016-08-01 06:57:58 +00:00
Austen McDonald a4dd6a4a25 Fix missing directory separators in config file specifications. 2016-07-31 22:02:37 +00:00
Austen McDonald 5c7040d593 Add template to SceneBasics 2016-07-31 22:02:02 +00:00
Vassyli ae63c209e9 Clean-ups
Left overs to clean and changes from discussion.

Fixed config path finding
2016-07-29 11:57:24 +02:00
Vassyli 712a89bdad Changes for configuration file approach
Packages that are either of type lotgd-crate or lotgd-module can add daenerys commands and doctrine entity directories by using a lotgd.yml configuration file in their directory root (the same one were composer.json is).

All namespaces given in lotgd.yml have to be relative to the packages namespace, without a leading backslash (\).

Root namespace is derived from composer.json, either explicitely (via extra.lotgd-namespace) or implicitely via the first psr-4 or the first psr-0 namespace.
2016-07-29 09:35:46 +02:00
Vassyli ba855d9b56 Added root package to ComposerManager->getPackages() 2016-07-29 09:35:46 +02:00
Vassyli 396e174fb5 Add working directory search path for composer
Added a needed search path for composer.json and a test testing exactly this.
2016-07-29 09:35:46 +02:00
Vassyli f136711884 Adds changes as discussed in PR#50 2016-07-29 09:35:46 +02:00
Vassyli b93aea6831 Changed daenerys to support bootstrap for new commands 2016-07-29 09:35:46 +02:00
Vassyli 58147ed14b Updated bootstrap to call packages Bootstrap
The bootstrap procedure has been updated to search through all packages to get the ones with an lotgd-namespace extra field. These are then tested if they have or have not a bootstrap class implementing BootstrapInterface. If yes, they get added to a stack used to modify the bootstrap procedure. For know, bootstrap supports additional entity directories.
2016-07-29 09:35:46 +02:00