Passed
Push — master ( 48bfaa...170129 )
by Nico
25:44
created

TShipItem::getWarpDriveState()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Stu\Module\Ship\Lib;
6
7
use Doctrine\ORM\Mapping\Column;
8
use Doctrine\ORM\Mapping\Entity;
9
use Doctrine\ORM\Mapping\Id;
10
use Stu\Component\Ship\SpacecraftTypeEnum;
11
12
#[Entity]
13
class TShipItem implements TShipItemInterface
14
{
15
    #[Id]
16
    #[Column(type: 'integer')]
17
    private int $ship_id = 0;
18
19
    #[Column(type: 'integer', nullable: true)]
20
    private ?int $fleet_id = null;
21
22
    #[Column(type: 'integer')]
23
    private int $rump_id = 0;
24
25
    #[Column(type: 'integer', nullable: true)]
26
    private ?int $former_rump_id = null;
27
28
    #[Column(type: 'integer', nullable: true)]
29
    private ?int $warp_state = null;
30
31
    #[Column(type: 'integer', nullable: true)]
32
    private ?int $tractor_warp_state = null;
33
34
    #[Column(type: 'integer', nullable: true)]
35
    private ?int $cloak_state = null;
36
37
    #[Column(type: 'integer', nullable: true)]
38
    private ?int $shield_state = null;
39
40
    #[Column(type: 'integer', nullable: true)]
41
    private ?int $uplink_state = null;
42
43
    #[Column(type: 'boolean')]
44
    private bool $is_destroyed = false;
45
46
    #[Column(type: 'integer')]
47
    private int $spacecraft_type = 0;
48
49
    #[Column(type: 'string')]
50
    private string $ship_name = '';
51
52
    #[Column(type: 'integer')]
53
    private int $hull = 0;
54
55
    #[Column(type: 'integer')]
56
    private int $max_hull = 0;
57
58
    #[Column(type: 'integer')]
59
    private int $shield = 0;
60
61
    #[Column(type: 'integer', nullable: true)]
62
    private ?int $web_id = null;
63
64
    #[Column(type: 'integer', nullable: true)]
65
    private ?int $web_finish_time = null;
66
67
    #[Column(type: 'integer')]
68
    private int $user_id = 0;
69
70
    #[Column(type: 'string')]
71
    private string $user_name = '';
72
73
    #[Column(type: 'integer')]
74
    private int $rump_category_id = 0;
75
76
    #[Column(type: 'string')]
77
    private string $rump_name = '';
78
79
    #[Column(type: 'integer', nullable: true)]
80
    private ?int $rump_role_id = null;
81
82
    #[Column(type: 'boolean')]
83
    private bool $has_logbook = false;
84
85
    #[Column(type: 'boolean')]
86
    private bool $has_crew = false;
87
88
    public function getShipId(): int
89
    {
90
        return $this->ship_id;
91
    }
92
93
    public function getFleetId(): ?int
94
    {
95
        return $this->fleet_id;
96
    }
97
98
    public function getRumpId(): int
99
    {
100
        return $this->rump_id;
101
    }
102
103
    public function getFormerRumpId(): ?int
104
    {
105
        return $this->former_rump_id;
106
    }
107
108
    public function getWarpDriveState(): int
109
    {
110
        return $this->warp_state ?? 0;
111
    }
112
113
    public function getTractorWarpState(): int
114
    {
115
        return $this->tractor_warp_state ?? 0;
116
    }
117
118
    public function getCloakState(): int
119
    {
120
        return $this->cloak_state ?? 0;
121
    }
122
123
    public function getShieldState(): int
124
    {
125
        return $this->shield_state ?? 0;
126
    }
127
128
    public function getUplinkState(): int
129
    {
130
        return $this->uplink_state ?? 0;
131
    }
132
133
    public function isDestroyed(): bool
134
    {
135
        return $this->is_destroyed;
136
    }
137
138
    public function getSpacecraftType(): SpacecraftTypeEnum
139
    {
140
        return SpacecraftTypeEnum::from($this->spacecraft_type);
141
    }
142
143
    public function getShipName(): string
144
    {
145
        return $this->ship_name;
146
    }
147
148
    public function getHull(): int
149
    {
150
        return $this->hull;
151
    }
152
153
    public function getMaxHull(): int
154
    {
155
        return $this->max_hull;
156
    }
157
158
    public function getShield(): int
159
    {
160
        return $this->shield;
161
    }
162
163
    public function getWebId(): ?int
164
    {
165
        return $this->web_id;
166
    }
167
168
    public function getWebFinishTime(): ?int
169
    {
170
        return $this->web_finish_time;
171
    }
172
173
    public function getUserId(): int
174
    {
175
        return $this->user_id;
176
    }
177
178
    public function getUserName(): string
179
    {
180
        return $this->user_name;
181
    }
182
183
    public function getRumpCategoryId(): int
184
    {
185
        return $this->rump_category_id;
186
    }
187
188
    public function getRumpName(): string
189
    {
190
        return $this->rump_name;
191
    }
192
193
    public function getRumpRoleId(): ?int
194
    {
195
        return $this->rump_role_id;
196
    }
197
198
    public function hasLogbook(): bool
199
    {
200
        return $this->has_logbook;
201
    }
202
203
    public function hasCrew(): bool
204
    {
205
        return $this->has_crew;
206
    }
207
}
208