# Path: Ecstatica/Game.py
# class NamesDB(object):
#     def __init__(self, nametype):
#         self.nametype = nametype
#         self.indices = {}
#         self.names = []
#         
#     def addName(self, name):
#         '''
#         Checks whether name is existing already in the DB and returns
#         its index in this case. Otherwise it adds it to the DB and
#         returns the new index
#         '''
#         if name in self.indices.keys():
#             return self.indices[name]
#         else:
#             newindex = len(self.indices)
#             self.indices[name] = newindex
#             self.names.append(name)
#             return newindex
#         
#     def addNames(self, namelist):
#         '''
#         Adds a list of names to the DB and returns a number of indices
#         '''
#         idxs = []
#         
#         for name in namelist:
#             idxs.append(self.addName(name))
#             
#         return idxs
#         
#     def __getitem__(self, name):
#         '''
#         Overload [] operator
#         '''
#         
#         return self.addName(name)  
#     
#     def __len__(self):
#         return len(self.names)      
#     
#     def append(self, name):
#         '''
#         Imitate list operation "append"
#         '''
#         
#         return self.addName(name)
#         
#     def __str__(self):
#         liste=[]
#         for entry in self.indices.keys():
#             liste.append(entry)
#         return "\n".join(liste)
#     
#     def __iter__(self):
#         return self.names.__iter__()
#     
#     def __next__(self):
#         return self.names.__next__()
#     
#     def __eq__(self, other):
#         if self.nametype != other.nametype:
#             print("Name type not equal")
#             return False
#         if self.indices != other.indices:
#             print("indices not equal")
#             return False
#         if self.names != other.names:
#             print("names not equal")
#             return False
#         
#         return True
#     
#     def __ne__(self, other):
#         return not self.__eq__(other)


from .Game import NamesDB
    def __init__(self):
        self.parts = []
        self.actors = []
        self.actions = []
        self.scenes = []
        self.points = []
        self.triangles = []
        self.repertoires = []
        
        self.mapareas = []
        self.codes = []
        self.sounds = []
        self.cameras = []
        self.sectorsections = []
        
        self.sectormap = None
        
        self.actorevents = []
        self.actionevents = []
        self.sceneevents = []
        self.repertoireevents = []
        
        self.partnames = NamesDB("Part")
        self.actornames = NamesDB("Actor")
        self.actionnames = NamesDB("Action")
        self.scenenames = NamesDB("Scene")
        self.pointnames = NamesDB("Point")
        self.trianglenames = NamesDB("Triangle")
        self.codenames = NamesDB("Code")
        self.repertoirenames = NamesDB("Repertoire")

# Path: Ecstatica/Game.py
# class NamesDB(object):
#     def __init__(self, nametype):
#         self.nametype = nametype
#         self.indices = {}
#         self.names = []
#         
#     def addName(self, name):
#         '''
#         Checks whether name is existing already in the DB and returns
#         its index in this case. Otherwise it adds it to the DB and
#         returns the new index
#         '''
#         if name in self.indices.keys():
#             return self.indices[name]
#         else:
#             newindex = len(self.indices)
#             self.indices[name] = newindex
#             self.names.append(name)
#             return newindex
#         
#     def addNames(self, namelist):
#         '''
#         Adds a list of names to the DB and returns a number of indices
#         '''
#         idxs = []
#         
#         for name in namelist:
#             idxs.append(self.addName(name))
#             
#         return idxs
#         
#     def __getitem__(self, name):
#         '''
#         Overload [] operator
#         '''
#         
#         return self.addName(name)  
#     
#     def __len__(self):
#         return len(self.names)      
#     
#     def append(self, name):
#         '''
#         Imitate list operation "append"
#         '''
#         
#         return self.addName(name)
#         
#     def __str__(self):
#         liste=[]
#         for entry in self.indices.keys():
#             liste.append(entry)
#         return "\n".join(liste)
#     
#     def __iter__(self):
#         return self.names.__iter__()
#     
#     def __next__(self):
#         return self.names.__next__()
#     
#     def __eq__(self, other):
#         if self.nametype != other.nametype:
#             print("Name type not equal")
#             return False
#         if self.indices != other.indices:
#             print("indices not equal")
#             return False
#         if self.names != other.names:
#             print("names not equal")
#             return False
#         
#         return True
#     
#     def __ne__(self, other):
#         return not self.__eq__(other)


# Path: Ecstatica/FantFile.py
from .Game import NamesDB

    def __init__(self):
        self.parts = []
        self.actors = []
        self.actions = []
        self.scenes = []
        self.points = []
        self.triangles = []
        self.repertoires = []
        
        self.mapareas = []
        self.codes = []
        self.sounds = []
        self.cameras = []
        self.sectorsections = []
        
        self.sectormap = None
        
        self.actorevents = []
        self.actionevents = []
        self.sceneevents = []
        self.repertoireevents = []
        
        self.partnames = NamesDB("Part")
        self.actornames = NamesDB("Actor")
        self.actionnames = NamesDB("Action")
        self.scenenames = NamesDB("Scene")
        self.pointnames = NamesDB("Point")
        self.trianglenames = NamesDB("Triangle")
        self.codenames = NamesDB("Code")
        self.repertoirenames = NamesDB("Repertoire")

        self.soundnames = NamesDB("Sound")