22 lines
539 B
PHP
22 lines
539 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Number of available seats for each time block
|
||
|
|
*/
|
||
|
|
class RsvTimetableAvailability {
|
||
|
|
/**
|
||
|
|
* @param array<int,int> $occupancy Number of available seats for each time block
|
||
|
|
*/
|
||
|
|
public function __construct(
|
||
|
|
public int $from_minutes,
|
||
|
|
public int $to_minutes,
|
||
|
|
public int $block_size_in_minutes,
|
||
|
|
public array $occupancy
|
||
|
|
) { }
|
||
|
|
|
||
|
|
public function push_block(int $capacity) {
|
||
|
|
$this->occupancy[] = $capacity;
|
||
|
|
$this->to_minutes += $this->block_size_in_minutes;
|
||
|
|
}
|
||
|
|
}
|