コード例 #1
0
 private void Awake()
 {
     narrador       = GameObject.FindGameObjectWithTag("DungeonMaster").GetComponent <Narrador>();
     lizaro         = GameObject.FindGameObjectWithTag("Player").GetComponent <Lizaro>();
     casaAbandonada = GameObject.FindGameObjectWithTag("Map").GetComponent <CasaAbandonada>();
     txt            = GameObject.FindGameObjectWithTag("DungeonMaster").GetComponent <Txt_NinhoAranha>();
 }
コード例 #2
0
 private void Awake()
 {
     narrador            = GameObject.FindGameObjectWithTag("DungeonMaster").GetComponent <Narrador>();
     lizaro              = GameObject.FindGameObjectWithTag("Player").GetComponent <Lizaro>();
     txt                 = GameObject.FindGameObjectWithTag("DungeonMaster").GetComponent <Txt_BaseAvancada>();
     cidadeElfosInimigos = GameObject.FindGameObjectWithTag("Map").GetComponent <CidadeElfosInimigos>();
 }
コード例 #3
0
ファイル: Gruta.cs プロジェクト: julianojstavares/tenus_game
 private void Awake()
 {
     narrador       = GameObject.FindGameObjectWithTag("DungeonMaster").GetComponent <Narrador>();
     lizaro         = GameObject.FindGameObjectWithTag("Player").GetComponent <Lizaro>();
     txt            = GameObject.FindGameObjectWithTag("DungeonMaster").GetComponent <Txt_Gruta>();
     vilaVerdejante = GameObject.FindGameObjectWithTag("Map").GetComponent <VilaVerdejante>();
 }
コード例 #4
0
 private void Awake()
 {
     narrador = GameObject.FindGameObjectWithTag("DungeonMaster").GetComponent <Narrador>();
     intro    = GameObject.FindGameObjectWithTag("DungeonMaster").GetComponent <Txt_Intro>();
     lizaro   = GameObject.FindGameObjectWithTag("Player").GetComponent <Lizaro>();
     tenus    = GameObject.FindGameObjectWithTag("Map").GetComponent <Tenus>();
 }
コード例 #5
0
        public async Task <Response> Insert(Narrador narrador)
        {
            Response response = new Response();

            if (string.IsNullOrWhiteSpace(narrador.Nome))
            {
                response.Erros.Add("O nome do narrador deve ser informado.");
            }
            else if (narrador.Nome.Length < 2 || narrador.Nome.Length > 50)
            {
                response.Erros.Add("O nome do narrador deve conyter entre 2 e 50 caracteres.");
            }

            if (response.Erros.Count > 0)
            {
                response.Sucesso = false;
                return(response);
            }

            try
            {
                await _narradorRepository.Insert(narrador);

                response.Sucesso = true;
                return(response);
            }
            catch (Exception ex)
            {
                response.Erros.Add("Erro no banco de dados, contate o administrador.");
                response.Sucesso = false;
                File.WriteAllText("log.txt", ex.Message + " - " + ex.StackTrace);
                return(response);
            }
        }
コード例 #6
0
 private void Awake()
 {
     narrador       = GameObject.FindGameObjectWithTag("DungeonMaster").GetComponent <Narrador>();
     lizaro         = GameObject.FindGameObjectWithTag("Player").GetComponent <Lizaro>();
     txt            = GameObject.FindGameObjectWithTag("DungeonMaster").GetComponent <Txt_CidadeElfosInimigos>();
     campoAberto    = GameObject.FindGameObjectWithTag("Map").GetComponent <CampoAberto>();
     casaAbandonada = GameObject.FindGameObjectWithTag("Map").GetComponent <CasaAbandonada>();
     ninhoAranha    = GameObject.FindGameObjectWithTag("Map").GetComponent <NinhoAranha>();
 }
コード例 #7
0
        public async Task <Response> Insert(Narrador narrador)
        {
            Response response = new Response();

            try
            {
                this._context.Narradores.Add(narrador);
                await this._context.SaveChangesAsync();

                response.Sucesso = true;
            }
            catch (Exception ex)
            {
                response.Erros.Add("Erro no banco de dados.");
                response.Sucesso = false;
                File.WriteAllText("log.txt", ex.Message + " - " + ex.StackTrace);
            }

            return(response);
        }
コード例 #8
0
        public async Task <IActionResult> Cadastrar(NarradorInsertViewModel viewModel)
        {
            var configuration = new MapperConfiguration(cfg =>
            {
                cfg.CreateMap <NarradorInsertViewModel, Narrador>();
            });
            IMapper  mapper   = configuration.CreateMapper();
            Narrador narrador = mapper.Map <Narrador>(viewModel);

            try
            {
                await this._narradorService.Insert(narrador);

                return(RedirectToAction("Index", "Competidor"));
            }
            catch (Exception ex)
            {
                ViewBag.Errors = ex.Message;
            }

            return(View());
        }
コード例 #9
0
 private void Awake()
 {
     narrador = GameObject.FindGameObjectWithTag("DungeonMaster").GetComponent <Narrador>();
     txt      = GameObject.FindGameObjectWithTag("DungeonMaster").GetComponent <Txt_VilaVerdejante>();
 }
コード例 #10
0
 public Task <Response> Delete(Narrador narrador)
 {
     throw new NotImplementedException();
 }