public CampaignsController(DnDEasyContext context, UserRepo urepo, CampaignRepo crepo, CharacterRepo repo)
 {
     _context = context;
     URepo    = urepo;
     CRepo    = crepo;
     Repo     = repo;
 }
Esempio n. 2
0
 public CharacterCampaignController(CharacterRepo repo, UserRepo urepo, CampaignRepo crepo)
 {
     // _context = context;
     Repo  = repo;
     URepo = urepo;
     CRepo = crepo;
 }
 public UsersController(CharacterRepo characters, CharacterService charService, IUserService userService, IMapper mapper)
 {
     _mapper      = mapper;
     _chars       = characters;
     _charService = charService;
     _userService = userService;
 }
Esempio n. 4
0
        // GET: Character/Edit/5
        public ActionResult Edit(int id)
        {
            var repo = new CharacterRepo();

            Character character = repo.GetCharacter(id);

            characterUserId = character.UserId;

            return(View(character));
        }
Esempio n. 5
0
        // GET: Character
        public ActionResult Index()
        {
            IEnumerable <Character> charList = new List <Character>();
            var repo = new CharacterRepo();

            charList = repo.GetAllCharacters();

            charList = charList.OrderByDescending(c => c.UserId).ToList();

            return(View(charList));
        }
Esempio n. 6
0
        public void TestCharacterModelLoading()
        {
            //Arrange
            CharacterCreationViewModel ccvm = new CharacterCreationViewModel();
            ICharacterContext          _Icc = new TestCharacterContext();
            CharacterRepo _cr = new CharacterRepo(_Icc);

            //Act
            ccvm.CharModels = _cr.GetAllCharModels();
            //Assert
            Assert.IsTrue(ccvm.CharModels.Count == 3);
        }
Esempio n. 7
0
        public ActionResult Delete(int id, Character character)
        {
            try
            {
                var repo = new CharacterRepo();

                repo.DeleteCharacter(id);

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
Esempio n. 8
0
        // GET: Character/Delete/5
        public ActionResult Delete(int id)
        {
            var repo = new CharacterRepo();

            Character character = repo.GetCharacter(id);

            if (character.UserId == 1)
            {
                return(RedirectToAction("Index"));
            }
            else
            {
                return(View(repo.GetCharacter(id)));
            }
        }
Esempio n. 9
0
        public ActionResult RandomCreate(Character character)
        {
            try
            {
                // TODO: Add insert logic here
                var repo = new CharacterRepo();

                repo.AddRandomCharacter(character);

                return(RedirectToAction("Index"));
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
                return(View());
            }
        }
Esempio n. 10
0
        public ActionResult Edit(Character character)
        {
            var repo = new CharacterRepo();

            if (characterUserId == 1)
            {
                if (HomeController._currentUser != null)
                {
                    repo.AddCharacter(character);
                }
            }
            else
            {
                repo.UpdateCharacter(character);
            }
            characterUserId = null;

            return(RedirectToAction("Index"));
        }
Esempio n. 11
0
        public void TestLoadingGame()
        {
            //Arrange
            CharacterCreationViewModel ccvm = new CharacterCreationViewModel();
            ICharacterContext          _Icc = new TestCharacterContext();
            IItemContext  _IIc         = new TestItemContext();
            CharacterRepo _cr          = new CharacterRepo(_Icc);
            ItemRepo      _ir          = new ItemRepo(_IIc);
            var           mvm          = new MapViewModel();
            var           tempItemList = new List <ItemViewModel>();

            //Act

            mvm.character = CharacterToCharacterVM.ToCharVM(_cr.GetById(5));
            foreach (Item item in _ir.GetAllItems(0))
            {
                tempItemList.Add(ItemToItemVM.ToItemVM(item));
            }
            mvm.allitems = tempItemList;
            //Assert
            Assert.IsTrue(mvm.character != null && mvm.character.CharacterModel != "");
            Assert.IsTrue(mvm.allitems.Count > 0);
        }
Esempio n. 12
0
 public MapController(CharacterRepo cr, ItemRepo ir)
 {
     _cr = cr;
     _ir = ir;
 }
Esempio n. 13
0
 public CharacterService(CharacterRepo CharacterRepo, IMapper mapper)
 {
     _chars  = CharacterRepo;
     _mapper = mapper;
 }
 public HomeController(ILogger <HomeController> logger, DataContext dataContext)
 {
     _logger        = logger;
     _characterRepo = new CharacterRepo(dataContext);
 }
 public CharactersController(CharacterService charService, IMapper mapper, CharacterRepo CharacterRepo)
 {
     _mapper      = mapper;
     _chars       = CharacterRepo;
     _charService = charService;
 }
Esempio n. 16
0
 public CharacterController(CharacterRepo cr, AccountRepo ar)
 {
     _ar = ar;
     _cr = cr;
 }
Esempio n. 17
0
        public ActionResult AddImage(Image img, HttpPostedFileBase file, int id)
        {
            var repo = new CharacterRepo();

            return(View("Details", repo.AddImage(img, file, id)));
        }
Esempio n. 18
0
        // GET: Character/Details/5
        public ActionResult Details(int id)
        {
            var repo = new CharacterRepo();

            return(View(repo.GetCharacter(id)));
        }
Esempio n. 19
0
 public ChracterAdminstrationController(CharacterRepo characters, CharacterService charService, IMapper mapper)
 {
     _mapper      = mapper;
     _chars       = characters;
     _charService = charService;
 }
Esempio n. 20
0
 public CharactersController(CharacterRepo repo)
 {
     // _context = context;
     Repo = repo;
 }
Esempio n. 21
0
 public MainWindow()
 {
     repo   = new CharacterRepo();
     charvm = new CharactersViewModel(repo);
     InitializeComponent();
 }