mirror of
https://github.com/scummvm/scummvm-web.git
synced 2026-06-20 05:45:49 +00:00
WEB: Use OO for objects
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user