Beispiel #1
0
    def remove(self):
        from the_tale.game.map.places.storage import resource_exchange_storage

        self._model.delete()

        resource_exchange_storage.update_version()
        resource_exchange_storage.refresh()
Beispiel #2
0
    def create(cls, place_1, place_2, resource_1, resource_2, bill):
        from the_tale.game.map.places.storage import resource_exchange_storage

        model = cls._model_class.objects.create(bill=bill._model if bill is not None else None,
                                                place_1=place_1._model if place_1 is not None else None,
                                                place_2=place_2._model if place_2 is not None else None,
                                                resource_1=resource_1,
                                                resource_2=resource_2)
        prototype = cls(model=model)

        resource_exchange_storage.add_item(prototype.id, prototype)
        resource_exchange_storage.update_version()

        return prototype