示例#1
0
        private World()
        {
            DbAccessController dbAccess = new DbAccessController();

            ItemList      = dbAccess.InitialiseItems();
            CharacterList = dbAccess.InitialiseCharacter();
            LocationList  = dbAccess.InitialiseLocations();
            ThePlayer     = new Player();
        }
示例#2
0
        private World()
        {
            DbAccessController dbAccess = new DbAccessController();

            ItemList                  = dbAccess.InitialiseItems();
            CharacterList             = dbAccess.InitialiseCharacter();
            LocationList              = dbAccess.InitialiseLocations();
            ThePlayer                 = new Player();
            ThePlayer.CurrentLocation = LocationList.Find(location => location.IsStart == true);

            foreach (Item item in ItemList)
            {
                Location newLocation = LocationList.Find(location => location.Id == item.LocationId);
                if (newLocation != null)
                {
                    newLocation.Additem(item);
                }

                if (item.Id == 3)
                {
                    ThePlayer.AddItem(item);
                }
            }
        }