示例#1
0
 public GameManagement(IUserRepo userR, IGameRepo gameR, IFeatureRepo featureR, IGenreRepo genreR)
 {
     usersTable    = userR;
     gamesTable    = gameR;
     featuresTable = featureR;
     genresTable   = genreR;
 }
示例#2
0
        public StorePage(IGameRepo gameRepo, IUserRepo userRepo, IBuyService buyService, IPriceCalculationStrategy calcStrat, LibraryPage lp, User usr)
        {
            libp             = lp;
            this._gameRepo   = gameRepo;
            this._userRepo   = userRepo;
            this._buyService = buyService;
            this._calcStrat  = calcStrat;
            storeUser        = usr;

            InitializeComponent();
            if (storeList == null)
            {
                storeList = new ObservableCollection <Game>();
            }
            //storeList = new ObservableCollection<Game> {
            //    new Game{Name=" "}
            //};


            List <string> names = new List <string>();

            storeList.Clear();
            foreach (var game in _gameRepo.getAllGames())
            {
                if (!names.Contains(game.Name))
                {
                    names.Add(game.Name);

                    storeList.Add(game);
                }
            }

            StoreLIst.Items.Clear();
            StoreLIst.ItemsSource = storeList;
        }
示例#3
0
 public GameService(IHighScoreService highscoreservice, IUserService userService, IGameRepo gameRepo, IWordsRepo wordsRepo)
 {
     _userService      = userService;
     _gameRepo         = gameRepo;
     _wordsRepo        = wordsRepo;
     _highScoreService = highscoreservice;
 }
示例#4
0
 public GameController(IQuizRepo quizRepo, IGameRepo gameRepo, IQuestionRepo questionRepo, UserManager <User> userMgr)
 {
     this.quizRepo     = quizRepo;
     this.gameRepo     = gameRepo;
     this.questionRepo = questionRepo;
     this.userMgr      = userMgr;
 }
 public RegistrationWindow(IGameRepo gameRepo, IUserRepo userRepo, IBuyService buyService, IPriceCalculationStrategy calcStrat)
 {
     this._gameRepo   = gameRepo;
     this._userRepo   = userRepo;
     this._buyService = buyService;
     this._calcStrat  = calcStrat;
     InitializeComponent();
 }
示例#6
0
        public LibraryController(IUserRepo userR, IGameRepo gameR, IGameLibraryRepo libraryGamesR)
        {
            usersTable        = userR;
            gamesTable        = gameR;
            libraryGamesTable = libraryGamesR;

            libraryViewModel = new LibraryViewModel();
        }
示例#7
0
        public LibraryPage(IGameRepo gameRepo, IUserRepo userRepo, IBuyService buyService, IPriceCalculationStrategy calcStrat, StorePage sp, User ActiveUser)
        {
            this._gameRepo   = gameRepo;
            this._userRepo   = userRepo;
            this._buyService = buyService;
            this._calcStrat  = calcStrat;
            this.LibraryUser = ActiveUser;
            if (sp == null)
            {
                stp = new StorePage(_gameRepo, _userRepo, _buyService, _calcStrat, this, this.LibraryUser);
            }
            else
            {
                stp = sp;
            }

            InitializeComponent();
            if (userLib == null)
            {
                userLib = new ObservableCollection <Game>();
            }
            //this.LibraryUser.UserLibrary.Clear();
            //_userRepo.UpdateUser(this.LibraryUser);
            //foreach(var libItm in _userRepo.getUserByLogin(this.LibraryUser.Login).UserLibrary)
            //{
            //    if (_gameRepo.FindById(libItm.GameId) == _gameRepo.FindByFullName("CSGO"))
            //    {

            //    }
            //    else
            //    {
            //         _buyService.BuyGame(_gameRepo.FindByFullName("CSGO"), this.LibraryUser);
            //    }
            //}


            userLib.Clear();
            foreach (var libItm in userRepo.getUsrDetails(LibraryUser.Id).UserLibrary)
            {
                userLib.Add(_gameRepo.FindById(libItm.GameId));
            }

            LibraryLIst.Items.Clear();
            LibraryLIst.ItemsSource = userLib;

            //foreach (var itm in _userRepo.getUsrDetails(LibraryUser.Id).UserLibrary)
            //{
            //    int i = 0;


            //    LibraryLIst.Resources.Add(i, _gameRepo.FindById(itm.GameId).Name);
            //    i++;

            //}
        }
示例#8
0
        public SignUpWindow(IGameRepo gameRepo, IUserRepo userRepo, IBuyService buyService, IPriceCalculationStrategy calcStrat)
        {
            //foreach (var usr in _userRepo.getAllUsers())
            //{
            //    Console.WriteLine(usr.Id.ToString());

            //}
            this._gameRepo   = gameRepo;
            this._userRepo   = userRepo;
            this._buyService = buyService;
            this._calcStrat  = calcStrat;
            InitializeComponent();
        }
示例#9
0
        public HomeController(IGameRepo gameR, IFeatureRepo featureR, IGenreRepo genreR, IPriceCategoryRepo categoryR, IUserRepo userR)
        {
            gamesTable           = gameR;
            featuresTable        = featureR;
            genresTable          = genreR;
            priceCategoriesTable = categoryR;
            usersTable           = userR;

            homeViewModel = new HomeViewModel {
                FeaturesFilters = featuresTable.GetAllFeatures(),
                GenresFilters   = genresTable.GetAllGenres(),
                PriceFilters    = priceCategoriesTable.GetAllCategories()
            };
        }
示例#10
0
 public MovesController(IGameRepo repo)
 {
     this.repo = repo;
 }
 public GamesController(IGameRepo repository)
 {
     _repository = repository;
 }
示例#12
0
 public BuyService(IUserRepo userRepo, IGameRepo gameRepo, IPriceCalculationStrategy priceCalculationStrategy)
 {
     _priceCalculationStrategy = priceCalculationStrategy;
     _UserRepo = userRepo;
     _GameRepo = gameRepo;
 }
示例#13
0
 public QuizAPIController(IQuizRepo quizRepo, IGameRepo gameRepo, UserManager <User> userMgr)
 {
     this.quizRepo = quizRepo;
     this.gameRepo = gameRepo;
     this.userMgr  = userMgr;
 }
示例#14
0
 public GameController(IUserRepo userR, IGameRepo gameR, ICartRepo cartR)
 {
     usersTable = userR;
     gamesTable = gameR;
     cartTable  = cartR;
 }
示例#15
0
 public HomeController(IBookRepo bookRepo, IAlbumRepo albumRepo, IGameRepo gameRepo)
 {
     br = bookRepo;
     ar = albumRepo;
     gr = gameRepo;
 }
示例#16
0
 public GameService(IGameRepo repo)
 {
     this.repo = repo;
 }
示例#17
0
 public GameService(IGameRepo repo)
 {
     _repo = repo;
 }
示例#18
0
 public GameController(IGameRepo gameRepo)
 {
     this.gameRepo = gameRepo;
 }
示例#19
0
 public GamesController(UserManager <User> userManager, IGameRepo repository, IMapper mapper)
 {
     _userManager = userManager;
     _repository  = repository;
     _mapper      = mapper;
 }
示例#20
0
 public GameService(IGameRepo gameRepo)
 {
     _gameRepo = gameRepo;
 }
 public DefaultCalculationStrategy(IGameRepo gameRepo)
 {
     _gameRepository = gameRepo;
 }
 public GameController(IGameRepo gameRepo, IDeckRepo deckRepo)
 {
     this._gameRepo = gameRepo;
     this._deckRepo = deckRepo;
 }