コード例 #1
0
ファイル: WorldBehavior.cs プロジェクト: jmurdick/WheelMUD
        /// <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
ファイル: WorldBehavior.cs プロジェクト: Hobbitron/WheelMUD
        /// <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);
            }
        }