GenPainterPE/src/Ad5001/GenPainterPE/utils/Range.php

32 lines
578 B
PHP
Raw Normal View History

2017-10-22 08:45:05 +00:00
<?php
namespace Ad5001\GenPainterPE\utils;
2017-10-22 08:45:05 +00:00
class Range {
/** @var int */
public $from;
/** @var int */
public $to;
/**
* Creates a Range class
*
* @param int $from
* @param int $to
*/
public function __construct(int $from, int $to) {
$this->from = $from;
$this->to = $to;
}
/**
* Check if a number is in the range
*
* @param int $toTest
* @return boolean
*/
public function isInRange(int $toTest){
return $this->from <= $toTest && $toTest < $this->to;
}
}