Completed
Branch master (2d3735)
by Midori
15:34 queued 05:33
created

World::setCells()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace MidoriKocak\GameOfLife;
4
5
/**
6
 * Class World
7
 * @package MidoriKocak\GameOfLife
8
 */
9
class World
10
{
11
    /**
12
     * Size of the square matrix.
13
     *
14
     * @var int
15
     */
16
    private $cells;
17
18
    /**
19
     * Number of max iterations.
20
     *
21
     * @var int
22
     */
23
    private $iterations;
24
25
    /**
26
     * Number of max species.
27
     *
28
     * @var int
29
     */
30
    private $species;
31
32
    /**
33
     * World constructor.
34
     *
35
     * @param int $cells
36
     * @param int $species
37
     * @param int $iterations
38
     */
39
    public function __construct(int $cells, int $species, int $iterations)
40
    {
41
        $this->setCells($cells);
42
        $this->setIterations($iterations);
43
        $this->setSpecies($species);
44
    }
45
46
    /**
47
     * Returns the size of the square matrix.
48
     *
49
     * @return int
50
     */
51
    public function getCells(): int
52
    {
53
        return $this->cells;
54
    }
55
56
    /**
57
     * Set's the size of the square matrix.
58
     *
59
     * @param int $cells
60
     */
61
    public function setCells(int $cells)
62
    {
63
        $this->cells = $cells;
64
    }
65
66
    /**
67
     * Returns the number of max iterations.
68
     *
69
     * @return int
70
     */
71
    public function getIterations(): int
72
    {
73
        return $this->iterations;
74
    }
75
76
    /**
77
     * Sets the number of max iterations.
78
     *
79
     * @param int $iterations
80
     */
81
    public function setIterations(int $iterations)
82
    {
83
        $this->iterations = $iterations;
84
    }
85
86
    /**
87
     * Returns the number of max species.
88
     *
89
     * @return int
90
     */
91
    public function getSpecies(): int
92
    {
93
        return $this->species;
94
    }
95
96
    /**
97
     * Sets the number of max species.
98
     *
99
     * @param int $species
100
     */
101
    public function setSpecies(int $species)
102
    {
103
        $this->species = $species;
104
    }
105
}