Completed
Branch master (83a2f0)
by De Cramer
02:40
created

BackGroundFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 23
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace eXpansion\Framework\Core\Model\Gui\Factory;
4
5
use FML\Controls\Quad;
6
use FML\Controls\Quads\Quad_BgsPlayerCard;
7
8
/**
9
 * Class LineBuilder
10
 *
11
 * @package eXpansion\Framework\Core\Model\Gui\Builders;
12
 * @author  oliver de Cramer <[email protected]>
13
 */
14
class BackGroundFactory
15
{
16
    /**
17
     * @param     $width
18
     * @param     $height
19
     * @param int $index
20
     *
21
     * @return Quad
22
     */
23
    public function create($width, $height, $index = 0)
24
    {
25
        $index = $index % 2;
26
27
        $background = Quad::create();
28
        $background->setSize($width, $height);
29
        if ($index == 0) {
30
            $background->setBackgroundColor("eee5");
31
        } else {
32
            $background->setBackgroundColor("eee3");
33
        }
34
        return $background;
35
    }
36
}
37
38