예제 #1
0
        public NotificationResult Excluir(Magia entidade)
        {
            var NotificationResult = new NotificationResult();

            try
            {
                if (entidade.CodMagia != 0)
                {
                    if (NotificationResult.IsValid)
                    {
                        _magiaRepositoro.Remover(entidade);
                        NotificationResult.Add("Cadastro excluido com Sucesso!");

                        return(NotificationResult);
                    }

                    else
                    {
                        return(NotificationResult.Add(new NotificationError("O codigo informado não existe!", NotificationErrorType.USER)));
                    }
                }

                else
                {
                    return(NotificationResult.Add(new NotificationError("O codigo informado não existe!", NotificationErrorType.USER)));
                }
            }

            catch (Exception ex)
            {
                return(NotificationResult.Add(new NotificationError(ex.Message)));
            }
        }
예제 #2
0
 /// <summary>
 /// Awake this instance.
 /// </summary>
 protected virtual void Awake()
 {
     m_battleManager = BattleManager.Instance; // PanelCounterの参照取得
     m_skillManager  = SkillManager.Instance;  // SkillManagerシングルトンインスタンス取得
     m_panelCounter  = PanelCounter.Instance;  // PanelCounterの参照取得
     m_magia         = Magia.Instance;         // Magiaの参照取得
 }
예제 #3
0
        public NotificationResult Atualizar(Magia entidade)
        {
            var NotificationResult = new NotificationResult();

            try
            {
                if (entidade.CodMagia != 0)
                {
                    entidade.CodMagia = entidade.CodMagia;
                }

                if (NotificationResult.IsValid)
                {
                    _magiaRepositoro.Atualizar(entidade);
                    NotificationResult.Add("Cadastro Alterado com Sucesso!");

                    return(NotificationResult);
                }

                else
                {
                    return(NotificationResult.Add(new NotificationError("O codigo informado não existe!", NotificationErrorType.USER)));
                }
            }
            catch (Exception)
            {
                return(NotificationResult.Add(new NotificationError("O codigo informado não existe!", NotificationErrorType.USER)));
            }
        }
예제 #4
0
        public NotificationResult Salvar(Magia entidade)
        {
            var NotificationResult = new NotificationResult();

            try
            {
                if (entidade.CodMagia != 0)
                {
                    entidade.CodMagia = entidade.CodMagia;

                    if (NotificationResult.IsValid)
                    {
                        _magiaRepositoro.Adicionar(entidade);
                        NotificationResult.Add("Cadastrado!");
                    }

                    return(NotificationResult);
                }

                else
                {
                    return(NotificationResult.Add(new NotificationError("Erro no cadastro!", NotificationErrorType.USER)));
                };
            }

            catch (Exception ex)
            {
                return(NotificationResult.Add(new NotificationError(ex.Message)));
            }
        }
예제 #5
0
        public NotificationResult Salvar(Magia entidade)
        {
            var notificationResult = new NotificationResult();

            try
            {
                if (entidade.CodMagia == 0)
                {
                    notificationResult.Add(new NotificationError("Qtde. de produtos no Estoque inválido.", NotificationErrorType.USER));
                }

                if (notificationResult.IsValid)
                {
                    _magia_Repositorio.Adicionar(entidade);

                    notificationResult.Add("Produto cadastrado com sucesso.");
                }

                notificationResult.Result = entidade;

                return(notificationResult);
            }
            catch (Exception ex)
            {
                return(notificationResult.Add(new NotificationError(ex.Message)));
            }
        }
예제 #6
0
        /// <summary>
        /// Awake this instance.
        /// </summary>
        protected virtual void Awake()
        {
            m_magia             = Magia.Instance;             // Magiaの参照取得
            m_skillManager      = SkillManager.Instance;      // SkillManagerの参照取得
            m_panelCounter      = PanelCounter.Instance;      // PanelCounterの参照取得
            m_panelManager      = PanelManager.Instance;      // PanelManagerの参照取得
            m_battleManager     = BattleManager.Instance;     // BattleManagerの参照取得
            m_gameManager       = GameManager.Instance;       // Magiaの参照取得
            m_soundManager      = SoundManager.Instance;
            m_panelFrameManager = PanelFrameManager.Instance; // PanelFrameManagerの参照取得
            m_magiaHPGauge      = GameObject.Find("MagiaHPGauge").GetComponentInChildren <HitPointGauge>();
            m_enemyHPGauge      = GameObject.Find("EnemyHPGauge").GetComponentInChildren <HitPointGauge>();
            m_enemySkillGauge   = GameObject.Find("EnemyHPGauge").GetComponentInChildren <EnemySkillGauge>();
            m_background        = GameObject.Find("Background").GetComponent <SpriteRenderer>();

            var debugger = Debugger.BattleDebugger.Instance;

            if (debugger.UseTargetStory)
            {
                m_chapter = ChapterManager.Instance.GetChapter(debugger.TargetStory);
            }
            else
            {
                // その章のChapterを取得
                m_chapter = ChapterManager.Instance.GetChapter();
            }
        }
예제 #7
0
 private void Awake()
 {
     chapterManager       = ChapterManager.Instance;
     magia                = Magia.Instance;
     panelCounter         = PanelCounter.Instance;
     touchGestureDetector = TouchGestureDetector.Instance;
     progress             = Progress.Instance;
 }
예제 #8
0
        private void Awake()
        {
            m_panelManager  = PanelManager.Instance;  // PanelManagerの参照取得
            m_battleManager = BattleManager.Instance; // BattleManagerの参照取得
            magia           = Magia.Instance;

            // パネルを開く枚数の初期値を指定
            OpenPanelQuantity = 24;
        }
예제 #9
0
        public bool UpdateMagia(Magia magia, int idUsuario)
        {
            var user = _dataUser.GetUser(idUsuario);

            if (user.Tipo == 0)
            {
                return(_dataMagia.UpdateMagia(magia));
            }
            return(false);
        }
예제 #10
0
        public bool AddMagia(Magia magia, int idUsuario)
        {
            var user = _dataUser.GetUser(idUsuario);

            if (user.Tipo == 0)
            {
                _dataMagia.AddMagia(magia);
                return(true);
            }
            return(false);
        }
        private void Awake()
        {
            m_touchGestureDetector = TouchGestureDetector.Instance; // shingleton,TouchGestureDetectorインスタンスの取得
            m_battleManager        = BattleManager.Instance;        // shingleton,BattleManagerインスタンスの取得
            m_magia = Magia.Instance;                               // 参照取得

            m_battleManager.m_BehaviourByState.AddListener((state) =>
            {
                // init時マギアの形態に応じてユニークスキルの条件値を設定する
                if (state == BattleManager.StateMachine.State.Init)
                {
                    //Condition = m_magia.UniqueSkillConditionByAttribute;
                }
            });
        }
예제 #12
0
        private void button2_Click(object sender, EventArgs e)
        {
            int           top    = 50;
            int           left   = 100;
            List <Magias> magia  = personagem.ListarMagia();
            Button        button = new Button();

            foreach (var Magia in magia)
            {
                button.Name = Magia.getID().ToString();
                button.Text = Magia.nome;
                this.Controls.Add(button);
                button.Click += Button_Click;
                //pictureBox3.Visible = true;
            }
        }
예제 #13
0
    public override Texture2D RenderStaticPreview(string assetPath, Object[] subAssets, int width, int height)
    {
        Magia magia = (Magia)target;

        if (magia.icono == null)
        {
            return(null);
        }
        Texture2D tex2d = magia.icono.texture;

        // example.PreviewIcon must be a supported format: ARGB32, RGBA32, RGB24,
        // Alpha8 or one of float formats
        Texture2D tex = new Texture2D(width, height);

        EditorUtility.CopySerialized(tex2d, tex);

        return(tex);
    }
예제 #14
0
    protected override void SpawnMagic(Magia magia, Vector2 position, float angle, Vector2 scale)
    {
        if (magia.Name == "wind" && !Viento || magia.Name == "water" && !Agua || magia.Name == "thunder" && !Trueno)
        {
            return;
        }

        GameObject effect;

        effect = Instantiate(magia.Effect, new Vector3(position.x, position.y, 0), Quaternion.identity) as GameObject;

        if (magia.Name == "wind")
        {
            effect.transform.localScale = scale;
            effect.GetComponent <AreaEffector2D>().forceAngle = angle;
            Destroy(effect, 4);
        }
        else if (magia.Name == "water")
        {
            effect.transform.rotation = Quaternion.Euler(90, 90, 0);
        }
    }
예제 #15
0
        /// <summary>
        /// Start this instance.a
        /// </summary>
        void Start()
        {
            // Inspectorで指定したフラグをここで代入する
            var targetTutorials = new Subject();

            targetTutorialsList.ForEach(item =>
            {
                targetTutorials = targetTutorials | item;
            });

            m_battleManager.m_BehaviourByState.AddListener((state) => // ステートマシンにイベント登録
            {
                Debug.Log($"{state}だよ!!!");
                if (state != BattleManager.StateMachine.State.PlayerChoice ||
                    m_battleManager.m_StateMachine.PreviousStateIsDebugging ||
                    m_battleManager.m_StateMachine.PreviousStateIsPause ||
                    m_battleManager.m_StateMachine.PreviousStateIsTutorial) // StateがPlayerChoice以外の時は処理終了
                {
                    return;
                }

                m_panelCounter.InitializeCounter();
                m_panelManager.InitPanels();
                m_panelFrameManager.MovingCenter();

                // Tutorialのフラグが立っていた時のみチュートリアルを再生しフラグを下げ二度と呼ばれないようにする
                progress         = Progress.Instance;
                var tutorialFlag = progress.TutorialProgressInBattleScene;
                if (targetTutorials == (tutorialFlag & targetTutorials))
                {
                    BattleSceneTutorialsPopper.Instance.Popup(targetTutorials);
                    progress.SetTutorialProgress(targetTutorials, false);
                }

                progress = Progress.Instance;
                magia    = Magia.Instance;
            });
        }
예제 #16
0
 public bool Post([FromBody] Magia magia, int idUser)
 {
     return(_serviceMagia.AddMagia(magia, idUser));
 }
예제 #17
0
 public string Excluir(Magia entidade)
 {
     return("");
 }
예제 #18
0
 public NotificationResult Excluir(Magia entidade)
 {
     return(_magiaServico.Excluir(entidade));
 }
예제 #19
0
 public NotificationResult Atualizar(Magia entidade)
 {
     return(_magiaServico.Atualizar(entidade));
 }
예제 #20
0
 public static void CarregarMagias()
 {
     magia [0] = new Magia("Fogo", Resources.Load <GameObject> ("Magias/Fogo"), Resources.LoadAll <Sprite>("ItemIcons")[8], 10, 1, EnumNivel.Tolo, 0, EnumElementos.Fogo);
     magia [1] = new Magia("Raio", Resources.Load <GameObject> ("Magias/Raio"), Resources.LoadAll <Sprite>("ItemIcons")[9], 20, 2, EnumNivel.Novato, 1, EnumElementos.Eletricidade);
     magia [2] = new Magia("Natureza", Resources.Load <GameObject> ("Magias/Veneno"), Resources.LoadAll <Sprite>("ItemIcons")[10], 30, 3, EnumNivel.Novato, 2, EnumElementos.Terra);
 }
예제 #21
0
 public NotificationResult Salvar(Magia entidade)
 {
     throw new NotImplementedException();
 }
 public NotificationResult Salvar(Magia entidade)
 {
     return(_magiaServico.Salvar(entidade));
 }
예제 #23
0
 public bool AddMagia(Magia magia)
 {
     _contextDb.Magias.Add(magia);
     _contextDb.SaveChanges();
     return true;
 }
예제 #24
0
 public bool UpdateMagia(Magia magia)
 {
     _contextDb.Magias.Update(magia);
     _contextDb.SaveChanges();
     return true;
 }
예제 #25
0
 protected abstract void SpawnMagic(Magia name, Vector2 position, float angle, Vector2 scale);
예제 #26
0
 public string Excluir(Magia entidade)
 {
     return(magia_Servico.Excluir(entidade));
 }
예제 #27
0
 public bool Put(int idUser, [FromBody] Magia magia)
 {
     return(_serviceMagia.UpdateMagia(magia, idUser));
 }