WEB: Use OO for objects

This commit is contained in:
Matan Bareket
2019-01-22 19:49:58 -05:00
parent e0f5656d84
commit 7afd0daf3f
12 changed files with 70 additions and 119 deletions
+19
View File
@@ -8,6 +8,25 @@ namespace ScummVM\Objects;
abstract class BasicObject
{
protected $name;
protected $description;
public function __construct($data)
{
$this->description = $data['description'];
$this->name = $data['name'];
}
/* Get the name. */
public function getName()
{
return $this->name;
}
public function getDescription()
{
return $this->description;
}
/**
* If the input array doesn't contain the numerical key 0, wrap it inside
* an array. This functions operates on the data directly.