Beispiel #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)));
            }
        }
Beispiel #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の参照取得
 }
Beispiel #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)));
            }
        }
Beispiel #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)));
            }
        }
Beispiel #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)));
            }
        }
        /// <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();
            }
        }
Beispiel #7
0
 private void Awake()
 {
     chapterManager       = ChapterManager.Instance;
     magia                = Magia.Instance;
     panelCounter         = PanelCounter.Instance;
     touchGestureDetector = TouchGestureDetector.Instance;
     progress             = Progress.Instance;
 }
Beispiel #8
0
        private void Awake()
        {
            m_panelManager  = PanelManager.Instance;  // PanelManagerの参照取得
            m_battleManager = BattleManager.Instance; // BattleManagerの参照取得
            magia           = Magia.Instance;

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

            if (user.Tipo == 0)
            {
                return(_dataMagia.UpdateMagia(magia));
            }
            return(false);
        }
Beispiel #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;
                }
            });
        }
Beispiel #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;
            }
        }
Beispiel #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);
    }
Beispiel #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);
        }
    }
Beispiel #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;
            });
        }
Beispiel #16
0
 public bool Post([FromBody] Magia magia, int idUser)
 {
     return(_serviceMagia.AddMagia(magia, idUser));
 }
Beispiel #17
0
 public string Excluir(Magia entidade)
 {
     return("");
 }
Beispiel #18
0
 public NotificationResult Excluir(Magia entidade)
 {
     return(_magiaServico.Excluir(entidade));
 }
Beispiel #19
0
 public NotificationResult Atualizar(Magia entidade)
 {
     return(_magiaServico.Atualizar(entidade));
 }
Beispiel #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);
 }
Beispiel #21
0
 public NotificationResult Salvar(Magia entidade)
 {
     throw new NotImplementedException();
 }
 public NotificationResult Salvar(Magia entidade)
 {
     return(_magiaServico.Salvar(entidade));
 }
Beispiel #23
0
 public bool AddMagia(Magia magia)
 {
     _contextDb.Magias.Add(magia);
     _contextDb.SaveChanges();
     return true;
 }
Beispiel #24
0
 public bool UpdateMagia(Magia magia)
 {
     _contextDb.Magias.Update(magia);
     _contextDb.SaveChanges();
     return true;
 }
Beispiel #25
0
 protected abstract void SpawnMagic(Magia name, Vector2 position, float angle, Vector2 scale);
Beispiel #26
0
 public string Excluir(Magia entidade)
 {
     return(magia_Servico.Excluir(entidade));
 }
Beispiel #27
0
 public bool Put(int idUser, [FromBody] Magia magia)
 {
     return(_serviceMagia.UpdateMagia(magia, idUser));
 }