Change sortKey to be an integer on ActionGroup

This commit is contained in:
Austen McDonald
2016-08-09 05:35:13 +00:00
parent b07dbd8f29
commit f6a6ceec9e
2 changed files with 6 additions and 6 deletions
+5 -5
View File
@@ -17,9 +17,9 @@ class ActionGroup
* Create a new ActionGroup, starting with an empty set of actions.
* @param string $id Unique identifier for this group, in the vendor/module/group format.
* @param string $title Title to display to the end user. Empty string means no title.
* @param string $sortKey Navigation menus are displayed in the order sorted by this string.
* @param int $sortKey Navigation menus are displayed in the order sorted by this integer.
*/
public function __construct(string $id, string $title, string $sortKey)
public function __construct(string $id, string $title, int $sortKey)
{
$this->id = $id;
$this->title = $title;
@@ -48,10 +48,10 @@ class ActionGroup
/**
* Returns the sort key for this group. The ordering of the groups in the
* final menu displayed to users will be sorted by this key. The default
* menu's sort key is 'A'.
* @return string
* menu's sort key is '0'.
* @return int
*/
public function getSortKey(): string
public function getSortKey(): int
{
return $this->sortKey;
}
+1 -1
View File
@@ -254,7 +254,7 @@ class Game
{
$v->setOwner($this->getCharacter());
$v->changeFromScene($s);
$ag = new ActionGroup('lotgd/core/default', '', 'A');
$ag = new ActionGroup('lotgd/core/default', '', 0);
$as = array_map(function ($c) { return new Action($c->getId()); }, $s->getChildren()->toArray());
$ag->setActions($as);