forked from pyfa-org/Pyfa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
citadel.py
41 lines (34 loc) · 1.53 KB
/
citadel.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# ===============================================================================
# Copyright (C) 2010 Diego Duclos
#
# This file is part of eos.
#
# eos is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# eos is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with eos. If not, see <http://www.gnu.org/licenses/>.
# ===============================================================================
from logbook import Logger
from eos.saveddata.ship import Ship
pyfalog = Logger(__name__)
class Citadel(Ship):
def validate(self, item):
if item.category.name != "Structure":
pyfalog.error("Passed item '{0}' (category: {1}) is not under Structure category", item.name, item.category.name)
raise ValueError(
'Passed item "%s" (category: (%s)) is not under Structure category' % (item.name, item.category.name))
def __deepcopy__(self, memo):
copy = Citadel(self.item)
return copy
def __repr__(self):
return "Citadel(ID={}, name={}) at {}".format(
self.item.ID, self.item.name, hex(id(self))
)