# Path: packer/placer.py
# class Rel:
#     def __init__(self, offset=0):
#         self.offset = offset
# 
#     def __add__(self, other):
#         return Rel(self.offset + other)
# 
#     def __sub__(self, other):
#         return Rel(self.offset - other)
# 
#     def __str__(self):
#         if self.offset == 0:
#             return '~'
#         return '~%d' % self.offset


import io
import os
import json
import zipfile
from .placer import Rel
        assert name not in self._props
        validator(value)
        self._props[name] = value
    return property(lambda self: self._props.get(name, default), setter)

class DatapackDefinition:

    def __init__(self):
        self._props = {}
        self.required = {'namespace', 'place_loc'}

    def validate_namespace(namespace):
        err = "Invalid namespace %r, should match [0-9a-z_-]+" % namespace
        assert namespace, err
        for char in namespace:
            assert char.isdigit() or (
                char.isalpha and not char.isupper()) or char in '_-', err

    def validate_place_loc(place_loc):
        pass

    def validate_spawn_loc(spawn_loc):
        pass

    def validate_descripiton(description):
        pass

    namespace = write_once_property('namespace', validate_namespace)
    place_loc = write_once_property('place_loc', validate_place_loc)
    spawn_loc = write_once_property('spawn_loc', validate_spawn_loc,

# Path: packer/placer.py
# class Rel:
#     def __init__(self, offset=0):
#         self.offset = offset
# 
#     def __add__(self, other):
#         return Rel(self.offset + other)
# 
#     def __sub__(self, other):
#         return Rel(self.offset - other)
# 
#     def __str__(self):
#         if self.offset == 0:
#             return '~'
#         return '~%d' % self.offset


# Path: packer/datapack.py
import io
import os
import json
import zipfile
from .placer import Rel

        assert name not in self._props
        validator(value)
        self._props[name] = value
    return property(lambda self: self._props.get(name, default), setter)

class DatapackDefinition:

    def __init__(self):
        self._props = {}
        self.required = {'namespace', 'place_loc'}

    def validate_namespace(namespace):
        err = "Invalid namespace %r, should match [0-9a-z_-]+" % namespace
        assert namespace, err
        for char in namespace:
            assert char.isdigit() or (
                char.isalpha and not char.isupper()) or char in '_-', err

    def validate_place_loc(place_loc):
        pass

    def validate_spawn_loc(spawn_loc):
        pass

    def validate_descripiton(description):
        pass

    namespace = write_once_property('namespace', validate_namespace)
    place_loc = write_once_property('place_loc', validate_place_loc)
    spawn_loc = write_once_property('spawn_loc', validate_spawn_loc,

                                    (Rel(0), Rel(0), Rel(0)))