-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
958 additions
and
161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Stu\Lib\Map\VisualPanel; | ||
|
||
abstract class CellData | ||
{ | ||
private ?string $subspaceCode; | ||
private ?string $displayCount; | ||
|
||
public function __construct( | ||
?string $subspaceCode, | ||
?string $displayCount | ||
) { | ||
$this->subspaceCode = $subspaceCode; | ||
$this->displayCount = $displayCount; | ||
} | ||
|
||
public function getSubspaceCode(): ?string | ||
{ | ||
return $this->subspaceCode; | ||
} | ||
|
||
public function getDisplayCount(): ?string | ||
{ | ||
return $this->displayCount; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Stu\Lib\Map\VisualPanel; | ||
|
||
class MapCellData extends CellData | ||
{ | ||
private ?string $mapGraphicPath; | ||
|
||
public function __construct( | ||
?string $mapGraphicPath, | ||
?string $subspaceCode, | ||
?string $displayCount | ||
) { | ||
parent::__construct($subspaceCode, $displayCount); | ||
|
||
$this->mapGraphicPath = $mapGraphicPath; | ||
} | ||
|
||
public function getMapGraphicPath(): ?string | ||
{ | ||
return $this->mapGraphicPath; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Stu\Lib\Map\VisualPanel; | ||
|
||
class SystemCellData extends CellData | ||
{ | ||
public const ONLY_BACKGROUND_IMAGE = 1; | ||
|
||
private int $x; | ||
private int $y; | ||
private int $systemFieldId; | ||
private bool $colonyShieldState; | ||
|
||
public function __construct( | ||
int $x, | ||
int $y, | ||
int $systemFieldId, | ||
bool $colonyShieldState, | ||
?string $subspaceCode, | ||
?string $displayCount | ||
) { | ||
parent::__construct($subspaceCode, $displayCount); | ||
|
||
$this->x = $x; | ||
$this->y = $y; | ||
$this->systemFieldId = $systemFieldId; | ||
$this->colonyShieldState = $colonyShieldState; | ||
} | ||
|
||
public function getSystemBackgroundId(): string | ||
{ | ||
return sprintf( | ||
'%02d%02d', | ||
$this->y, | ||
$this->x | ||
); | ||
} | ||
|
||
public function getSystemFieldId(): ?int | ||
{ | ||
if ($this->systemFieldId === self::ONLY_BACKGROUND_IMAGE) { | ||
return null; | ||
} | ||
|
||
return $this->systemFieldId; | ||
} | ||
|
||
public function getColonyShieldState(): bool | ||
{ | ||
return $this->colonyShieldState; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.