public AnimalSanctuaryController() { _image = new ImageDBRepository(); _animal = new AnimalDBRepository(); _sounds = new SoundDBRepository(); _profile = new ProfileDBRepository(System.Web.HttpContext.Current); _options = new OptionsDBRepository(); }
const int LOWEST_DIFF = 1; //lowest diff level public PlayControllerTests() { _controller = new PlayController(); _image = new ImageDBRepository(); _map = new MapDBRepository(); _progress = new ProfileProgressDBRepository(); _minigame = new MiniGamesDBRepository(); _options = new OptionsDBRepository(); }
/********************************************************************** * Purpose: Saves the name of the selected profile to the session variable, * note the parameter must be nullable. The parameter passed in is an index * to the profile the user selected on the choose profiles page. ***********************************************************************/ public void SelectedProfile(int?id) { int selectedIndex = (int)id; List <Profile> allProfs = _profileRepo.GetList(); Options options = new Options(); OptionsDBRepository repo = new OptionsDBRepository(); //find the profile the user clicked for (int i = 0; i < allProfs.Count(); i++) { //assign the used profileID to the session variables if (i == selectedIndex) { Session["profileID"] = allProfs[i].ID; options = repo.Get((int)Session["profileID"]); Session["toggleSound"] = options.toggleSound; //set Session variables for toggle music and sound Session["toggleMusic"] = options.toggleMusic; } } }
public OptionsController() { m_optionsRepository = new OptionsDBRepository(); }