Internal rework pending editframe
This commit is contained in:
@@ -2,18 +2,36 @@
|
||||
|
||||
namespace App\Classes;
|
||||
|
||||
use App\Classes\Control\EditFrame;
|
||||
use App\Classes\Control\Register;
|
||||
use App\Classes\Control\Telnet;
|
||||
|
||||
abstract class Control
|
||||
{
|
||||
// Has this control class finished with input
|
||||
protected $complete = FALSE;
|
||||
|
||||
// The server object that is running this control class
|
||||
protected $so = NULL;
|
||||
|
||||
// The frame applicable for this control (not the current rendered frame, thats in $so)
|
||||
protected $fo = NULL;
|
||||
|
||||
/**
|
||||
* What is the state of the server outside of this control.
|
||||
* Should only contain
|
||||
* + mode = Mode to follow outside of the control method
|
||||
* + action = Action to run after leaving the control method
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $state = [];
|
||||
|
||||
public function __construct(Server $so) {
|
||||
public function __construct(Server $so,Frame $fo=NULL) {
|
||||
$this->so = $so;
|
||||
$this->fo = $fo;
|
||||
|
||||
// Boot control, preparing anything before keyboard entry
|
||||
$this->boot();
|
||||
}
|
||||
|
||||
@@ -31,8 +49,11 @@ abstract class Control
|
||||
}
|
||||
|
||||
// @todo Change to Dynamic Calls by the existence of files in App\Classes\Control
|
||||
public static function factory(string $name, Server $so) {
|
||||
public static function factory(string $name,Server $so,Frame $fo=NULL) {
|
||||
switch ($name) {
|
||||
case 'editframe':
|
||||
return new EditFrame($so,$fo);
|
||||
|
||||
case 'register':
|
||||
return new Register($so);
|
||||
|
||||
@@ -44,5 +65,5 @@ abstract class Control
|
||||
}
|
||||
}
|
||||
|
||||
abstract public function handle(string $char);
|
||||
abstract public function handle(string $read);
|
||||
}
|
Reference in New Issue
Block a user