private World() { DbAccessController dbAccess = new DbAccessController(); ItemList = dbAccess.InitialiseItems(); CharacterList = dbAccess.InitialiseCharacter(); LocationList = dbAccess.InitialiseLocations(); ThePlayer = new Player(); }
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); } } }