Completed
Pull Request — master (#51)
by
unknown
02:35
created

BackGroundFactory::create()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 15
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 15
ccs 0
cts 12
cp 0
rs 9.4285
cc 2
eloc 9
nc 2
nop 3
crap 6
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
    public function create($width, $height, $index = 0)
17
    {
18
        $index = $index % 2;
19
20
        // TODO set proper default size & font.
21
22
        $background = new Quad();
23
        $background->setSize($width, $height);
24
        if ($index == 0) {
25
            $background->setBackgroundColor("eee5");
26
        } else {
27
            $background->setBackgroundColor("eee3");
28
        }
29
        return $background;
30
    }
31
}
32