# Collection of code snippets by Arne Vajhøj 
# (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) 
TRUCK = 1
TRAILER = 2
TOOL = 3

PERMOPEN = 1
COVERABLE = 2
REALROOF = 3

class Asset(object):
    def __init__(self, _id = 0, _description = '', _assettype = 0):
        self.id = _id
        self.description = _description
        self.assettype = _assettype

class TruckAsset(Asset):
    def __init__(self, _id = 0, _description = '', _model = '', _license = '', _towcapacity = 0):
        super(TruckAsset, self).__init__(_id, _description, TRUCK)
        self.model = _model
        self.license = _license
        self.towcapacity = _towcapacity

class TrailerAsset(Asset):
    def __init__(self, _id = 0, _description = '', _ownweight = 0, _maxcargo = 0, _roof = 0):
        super(TrailerAsset, self).__init__(_id, _description, TRAILER)
        self.ownweight = _ownweight
        self.maxcargo = _maxcargo
        self.roof = _roof

class ToolAsset(Asset):
    def __init__(self, _id = 0, _description = '', _tooltype = '', _name = '', _weight = 0):
        super(ToolAsset, self).__init__(_id, _description, TOOL)
        self.tooltype = _tooltype
        self.name = _name
        self.weight = _weight

