public CampaignsController(DnDEasyContext context, UserRepo urepo, CampaignRepo crepo, CharacterRepo repo)
 {
     _context = context;
     URepo    = urepo;
     CRepo    = crepo;
     Repo     = repo;
 }
Exemplo 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;
 }
Exemplo 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));
        }
Exemplo 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));
        }
Exemplo 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);
        }
Exemplo n.º 7
0
        public ActionResult Delete(int id, Character character)
        {
            try
            {
                var repo = new CharacterRepo();

                repo.DeleteCharacter(id);

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
Exemplo 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)));
            }
        }
Exemplo 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());
            }
        }
Exemplo 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"));
        }
Exemplo 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);
        }
Exemplo n.º 12
0
 public MapController(CharacterRepo cr, ItemRepo ir)
 {
     _cr = cr;
     _ir = ir;
 }
Exemplo 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;
 }
Exemplo n.º 16
0
 public CharacterController(CharacterRepo cr, AccountRepo ar)
 {
     _ar = ar;
     _cr = cr;
 }
Exemplo n.º 17
0
        public ActionResult AddImage(Image img, HttpPostedFileBase file, int id)
        {
            var repo = new CharacterRepo();

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

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