lib/Game/Snake/Text.pm untested

filter: Statementstmt 0.0% 0 / 24 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 4 Podpod n/a totaltotal 0.0% 0 / 32 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 use 5.38.0;
2 use experimental 'class';
3 package Game::Snake::Text 0.11;
4 class Game::Snake::Text {
5 our $VERSION = 0.11;
6 use Raylib::FFI;
7 use Raylib::Color;
8  
9 field $size : param;
10 field $x : param;
11 field $y : param;
12 field $text : param = "";
13 field $color : param = Raylib::Color::WHITE;
14  
15 method draw ($text, @position) {
16 @position = ($x, $y) unless @position;
17 DrawText( $text, @position, $size, $color );
18 }
19  
20 method text (@txt) {
21 $text = $txt[0] if @txt;
22 $text;
23 }
24 }
25  
26 1;
27  
28 =pod
29  
30 =cut