示例#1
0
        /// <summary>
        ///
        /// </summary>
        public void Initialize()
        {
            foreach (var superAreaDAO in SuperAreaRepository.Instance.All)
            {
                var instance = new SuperAreaInstance(superAreaDAO);
                WorldService.Instance.AddUpdatable(instance);
                WorldService.Instance.Dispatcher.AddHandler(instance.SafeDispatch);

                m_superAreaById.Add(superAreaDAO.Id, instance);
            }

            foreach (var areaDAO in AreaRepository.Instance.All)
            {
                var instance = new AreaInstance(areaDAO);
                instance.SuperArea.AddUpdatable(instance);
                instance.SuperArea.AddHandler(instance.SafeDispatch);

                m_areaById.Add(areaDAO.Id, instance);
            }

            foreach (var subAreaDAO in SubAreaRepository.Instance.All)
            {
                var instance = new SubAreaInstance(subAreaDAO);
                instance.Area.AddHandler(instance.SafeDispatch);
                m_subAreaById.Add(subAreaDAO.Id, instance);
            }
        }
示例#2
0
        /// <summary>
        ///
        /// </summary>
        public new void Dispose()
        {
            SubArea.RemoveUpdatable(this);
            SubArea.RemoveHandler(base.Dispatch);

            m_entityById.Clear();
            m_entityById = null;

            m_entityByName.Clear();
            m_entityByName = null;

            m_cells.Clear();
            m_cells = null;

            m_subArea = null;

            Pathmaker = null;

            base.Dispose();
        }