2970bd09d7
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.
41 lines
1012 B
YAML
41 lines
1012 B
YAML
characters:
|
|
-
|
|
id: 1
|
|
name: "Char without a Scene"
|
|
displayName: "A"
|
|
-
|
|
id: 2
|
|
name: "Char with a Scene"
|
|
displayName: "B"
|
|
viewpoints:
|
|
-
|
|
owner_id: 2
|
|
title: "The Village"
|
|
description: "This is the village."
|
|
template: "lotgd/tests/village"
|
|
data: "a:0:{}"
|
|
attachments: "a:0:{}"
|
|
actionGroups: "a:0:{}"
|
|
scenes:
|
|
-
|
|
id: 1
|
|
title: "The Village"
|
|
description: "This is the village."
|
|
template: "lotgd/tests/village"
|
|
-
|
|
id: 2
|
|
title: "The Forest"
|
|
description: "This is a very dangerous and dark forest"
|
|
template: "lotgd/tests/forest"
|
|
-
|
|
id: 3
|
|
title: "The Weaponry"
|
|
description: "This is the place where you can buy awesome weapons"
|
|
template: "lotgd/tests/weaponry"
|
|
scene_connections:
|
|
-
|
|
outgoing_scene_id: 1
|
|
incoming_scene_id: 2
|
|
-
|
|
outgoing_scene_id: 1
|
|
incoming_scene_id: 3 |