Пример #1
0
        /// <summary>Loads areas into the world.</summary>
        public void Load()
        {
            var areaRepository             = new RelationalRepository <AreaRecord>();
            ICollection <AreaRecord> areas = areaRepository.GetAll();

            foreach (var areaRecord in areas)
            {
                var areaBehavior = new AreaBehavior()
                {
                    ID = areaRecord.ID,
                };
                var area = new Thing(areaBehavior)
                {
                    Name = areaRecord.Name,
                    Id   = "area/" + areaRecord.ID,
                };

                // Load this area and it's children.
                areaBehavior.Load();
                this.Parent.Add(area);
            }
        }
Пример #2
0
        /// <summary>
        /// Loads areas into the world.
        /// </summary>
        public void Load()
        {
            var areaRepository = new AreaRepository();
            ICollection<AreaRecord> areas = areaRepository.FetchAll();

            foreach (var areaRecord in areas)
            {
                var areaBehavior = new AreaBehavior()
                {
                    ID = areaRecord.ID,
                };
                var area = new Thing(areaBehavior)
                {
                    Name = areaRecord.Name,
                    ID = "area/" + areaRecord.ID,
                };

                // Load this area and it's children.
                areaBehavior.Load();
                this.Parent.Add(area);
            }
        }