# Path: cuwo/static.py
# class StaticEntityHeader(WrapStaticEntityHeader):
#     def is_dynamic(self):
#         return self.get_type() in DYNAMIC_ENTITIES
# 
#     def get_type(self):
#         return strings.STATIC_NAMES[self.entity_type]
# 
#     def set_type(self, name):
#         self.entity_type = strings.STATIC_IDS[name]


import unittest
import sys
import os
import zlib
import subprocess
from cuwo import tgen
from cuwo.bytes import ByteReader
from cuwo.static import StaticEntityHeader
# cuwo is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cuwo 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cuwo.  If not, see <http://www.gnu.org/licenses/>.


sys.path.append('.')


class TerrainGeneratorTests(unittest.TestCase):
    def setUp(self):
        print('Initializing tgen')
        tgen.initialize(26879, './data/')
        print('Done')

    def test_static_entities(self):
        with open('./tests/tgen_static.dat', 'rb') as fp:
            data = zlib.decompress(fp.read())

        reader = ByteReader(data)
        source = []
        while reader.get_left() > 0:

# Path: cuwo/static.py
# class StaticEntityHeader(WrapStaticEntityHeader):
#     def is_dynamic(self):
#         return self.get_type() in DYNAMIC_ENTITIES
# 
#     def get_type(self):
#         return strings.STATIC_NAMES[self.entity_type]
# 
#     def set_type(self, name):
#         self.entity_type = strings.STATIC_IDS[name]


# Path: tests/test_tgen.py
import unittest
import sys
import os
import zlib
import subprocess
from cuwo import tgen
from cuwo.bytes import ByteReader
from cuwo.static import StaticEntityHeader

# cuwo is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cuwo 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cuwo.  If not, see <http://www.gnu.org/licenses/>.


sys.path.append('.')


class TerrainGeneratorTests(unittest.TestCase):
    def setUp(self):
        print('Initializing tgen')
        tgen.initialize(26879, './data/')
        print('Done')

    def test_static_entities(self):
        with open('./tests/tgen_static.dat', 'rb') as fp:
            data = zlib.decompress(fp.read())

        reader = ByteReader(data)
        source = []
        while reader.get_left() > 0:

            entity = StaticEntityHeader()