Refactored TDF processing PHP code to confirm to new TDF format
This commit is contained in:
35
build/scripts/Targets/TargetDescriptionFiles/BitField.php
Normal file
35
build/scripts/Targets/TargetDescriptionFiles/BitField.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace Targets\TargetDescriptionFiles;
|
||||
|
||||
class BitField
|
||||
{
|
||||
public ?string $key = null;
|
||||
public ?string $name = null;
|
||||
public ?string $description = null;
|
||||
public ?int $mask = null;
|
||||
public ?string $access = null;
|
||||
|
||||
public function __construct(
|
||||
?string $key,
|
||||
?string $name,
|
||||
?string $description,
|
||||
?int $mask,
|
||||
?string $access
|
||||
) {
|
||||
$this->key = $key;
|
||||
$this->name = $name;
|
||||
$this->description = $description;
|
||||
$this->mask = $mask;
|
||||
$this->access = $access;
|
||||
}
|
||||
|
||||
public function intersectsWith(BitField $other): bool
|
||||
{
|
||||
return
|
||||
$this->mask !== null
|
||||
&& $other->mask !== null
|
||||
&& ($this->mask & $other->mask) !== 0
|
||||
;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user