示例#1
0
    public void Init()
    {
        MANAGER.AddEnemyToList(this);
        AttackRange    = attackRange;
        Speed          = speed;
        IdleRange      = idleRange;
        AttackCD       = attackCD;
        AttackDuration = attackDuration;
        PassiveRange   = passiveRange;
        BaseHealth     = health;
        Level          = level;
        Team           = 1;

        BaseDamage     = baseDamage;
        DamagePerLevel = damagePerLevel;

        BaseArmor     = baseArmor;
        ArmorPerLevel = armorPerLevel;

        HealthPerLevel = healthPerLevel;

        UpdateStats();

        GameObject DamageHit = new GameObject("HitPoints");

        DamageHit.transform.SetParent(GameObject.Find("Canvas").transform);
        HealthTextEnnemy Script = DamageHit.AddComponent <HealthTextEnnemy>();

        Script.Init(transform);

        GetComponent <NavMeshAgent>().speed = GetSpeed;
    }
示例#2
0
        /////////////////////
        #region pageload
        protected void Page_Load(object sender, EventArgs e)
        {
            /////////////////////
            #region userId_Verify
            if (Session["User"] == null)
            {
                userId = 0;
            }
            else
            {
                userId = (int)(Session["User"]);
            }
            #endregion
            /////////////////////
            string  treceita  = Convert.ToString(Session["tipodereceita"]);
            string  textsearh = Convert.ToString(Session["textsearch"]);
            MANAGER m         = new MANAGER();
            DataSet ds        = m.GetDataSBAR(treceita, textsearh);

            GridView1.DataSource = ds;
            GridView1.DataBind();

            Repeater1.DataSource = ds;
            Repeater1.DataBind();
        }
示例#3
0
 /////////////////////
 #region pesquisar_receitas
 protected void btnhomesearch_Click(object sender, EventArgs e)
 {
     Session["tipodereceita"] = dropdownhome.SelectedItem.Text;
     Session["textsearch"]    = searchhome.Text;
     if (Session["User"] == null)
     {
         Response.Redirect("Receitaporpesquisa.aspx");
     }
     else
     {
         if ((string)Session["tipodereceita"] == "Nome")
         {
             int     userS   = (int)Session["User"];
             string  userST  = searchhome.Text;
             string  userSTT = dropdownhome.SelectedItem.Text;
             MANAGER m       = new MANAGER();
             m.InserirLastSearch(userS, userST, userSTT);
             Response.Redirect("Receitaporpesquisa.aspx");
         }
         else
         {
             Response.Redirect("Receitaporpesquisa.aspx");
         }
     }
 }
示例#4
0
        /// <summary>
        /// Возвратить наименование элемента списка (специальная вкладка)
        /// </summary>
        /// <param name="modeManager">Тип вкладки</param>
        /// <param name="modeComponent">Режим компонентов ТЭЦ</param>
        /// <returns>Строка - подпись для элемента списка</returns>
        public string getNameAdminValues(MANAGER modeManager, MODE_TECCOMPONENT modeComponent)
        {
            string[] arNameAdminValues = { "НСС" /*TEC*/, "Диспетчер" /*GTP*/, "НСС" /*PC*/, "НСС" /*TG*/ };
            string   prefix            = ((modeManager == MANAGER.DISP) || (modeManager == MANAGER.NSS)) ? @"ПБР" : (modeManager == MANAGER.ALARM) ? @"Сигн." : @"Неизвестно";

            return(prefix + @" - " + arNameAdminValues[(int)modeComponent]);
        }
        /// <summary>
        /// Возвратить наименование элемента списка (специальная вкладка)
        /// </summary>
        /// <param name="modeManager">Тип вкладки</param>
        /// <param name="modeComponent">Режим компонентов ТЭЦ</param>
        /// <returns>Строка - подпись для элемента списка</returns>
        public string getNameAdminValues(MANAGER modeManager, MODE_TECCOMPONENT modeComponent)
        {
            string[] arNameAdminValues = { "НСС" /*TEC*/, "Диспетчер" /*GTP*/, "НСС" /*PC*/, "НСС" /*TG*/ };
            string   prefix            = new List <MANAGER>()
            {
                MANAGER.NSS, MANAGER.DISP, MANAGER.LK, MANAGER.TEPLOSET
            }.Contains(modeManager) == true ? HAdmin.PBR_PREFIX
                : (modeManager == MANAGER.ALARM) ? @"Сигн."
                    : @"Неизвестно";

            switch (modeManager)
            {
            case MANAGER.LK:
                prefix += @" - ЛК";
                break;

            case MANAGER.TEPLOSET:
                prefix += @" - Теплосеть";
                break;

            default:
                prefix += @" - " + arNameAdminValues[(int)modeComponent];
                break;
            }

            return(prefix);
        }
示例#6
0
    public virtual void PassiveAction()
    {
        float distance = Vector3.Distance(MANAGER.GetPlayerPos, transform.position);

        if (distance >= IdleRange)
        {
            AIState = IDLE;
            return;
        }
        if (distance < PassiveRange && MANAGER.CanGetAgressive(5))
        {
            AIState = AGRESSIVE;
            return;
        }
        else if (distance < PassiveRange)
        {
            PositionGoal = (transform.position - MANAGER.GetPlayerPos).normalized * PassiveRange;
            NavMeshAgent agent = GetComponent <NavMeshAgent>();
            agent.SetDestination(PositionGoal);
            //GetAwwaysFromPlayer
        }
        else if (GetComponent <NavMeshAgent>().isStopped)
        {
            PositionGoal   = (Random.insideUnitSphere + MANAGER.GetPlayerPos).normalized * PassiveRange;
            PositionGoal.y = 0;
            NavMeshAgent agent = GetComponent <NavMeshAgent>();
            agent.SetDestination(PositionGoal);
            //Move ARROUND HIM
        }
    }
示例#7
0
        public ActionResult DeleteConfirmed(int id)
        {
            MANAGER mANAGER = db.MANAGERs.Find(id);

            db.MANAGERs.Remove(mANAGER);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
        public void iInitialize()
        {
            EventSystem = MANAGER.CheckScriptAvailability <EventSystem>("EventSystem", DefaultEventSystemPrefab);

            MinimapCamera = MANAGER.CheckScriptAvailability <Camera>("MinimapCamera", DefaultMinimapCameraPrefab);

            Minimap = MANAGER.CheckScriptAvailability <Minimap>("MinimapCanvas", DefaultMinimapPrefab);
        }
示例#9
0
 public override void CheckDeath(Entity Attacker)
 {
     if (Health <= 0)
     {
         Attacker.OnKill(this);
         MANAGER.RemoveEnemyToList(this);
         Destroy(gameObject);
     }
 }
示例#10
0
 public ActionResult Edit([Bind(Include = "id,username,password,role")] MANAGER mANAGER)
 {
     if (ModelState.IsValid)
     {
         db.Entry(mANAGER).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(mANAGER));
 }
示例#11
0
        public ActionResult Create([Bind(Include = "id,username,password,role")] MANAGER mANAGER)
        {
            if (ModelState.IsValid)
            {
                db.MANAGERs.Add(mANAGER);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(mANAGER));
        }
示例#12
0
        private void button1_Click(object sender, EventArgs e)
        {
            MANAGER M = new MANAGER();

            if (textBox1.Text == M.username && textBox2.Text == M.password)
            {
                admincontrols ac = new admincontrols();
                ac.Show();
            }
            else
            {
                MessageBox.Show("ACCESS DENIED");
            }
        }
示例#13
0
        // GET: Admin/MANAGER/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            MANAGER mANAGER = db.MANAGERs.Find(id);

            if (mANAGER == null)
            {
                return(HttpNotFound());
            }
            return(View(mANAGER));
        }
示例#14
0
        /////////////////////
        #region atribuição_Sources
        public void Refreshdata()
        {
            m = new MANAGER();
            m.listadeIngredientes();
            foreach (INGREDIENT Ingrediente in m.listadeIngredientes())
            {
                if (!cboxPIngredienteuban.Items.Contains(Ingrediente.IngredienteNome))
                {
                    cboxPIngredienteuban.Items.Add(Ingrediente.IngredienteNome);
                }
            }

            cboxPCcomment.DataSource    = m.listadeCMA();
            cboxCommentUBAN.DataSource  = m.listadeCMB();
            cboxcommentUA.DataSource    = m.listadeCMUA();
            cboxUserBanPU.DataSource    = m.listadeUSERSbanidos();
            cboxUserubanPU.DataSource   = m.listadeUSERS();
            cboxnaoaprovadas.DataSource = m.listadeRECEITASUA();
            cboxPRruban.DataSource      = m.listadeRECEITASA();
            cboxPRrBAN.DataSource       = m.listadeRECEITASB();
        }
示例#15
0
        /////////////////////
        #region pageload
        protected void Page_Load(object sender, EventArgs e)
        {
            /////////////////////
            #region userId_Verify
            if (Session["User"] == null)
            {
                userId = 0;
            }
            else
            {
                userId = (int)(Session["User"]);
            }
            #endregion
            /////////////////////
            MANAGER m  = new MANAGER();
            DataSet ds = m.GetData();

            GridView1.DataSource = ds;
            GridView1.DataBind();

            Repeater1.DataSource = ds;
            Repeater1.DataBind();
        }
示例#16
0
        /// <summary>
        /// Возвратить наименование элемента списка (специальная вкладка)
        /// </summary>
        /// <param name="modeManager">Тип вкладки</param>
        /// <param name="modeComponent">Режим компонентов ТЭЦ</param>
        /// <returns>Строка - подпись для элемента списка</returns>
        public string getNameAdminValues(MANAGER modeManager, MODE_TECCOMPONENT modeComponent)
        {
            string[] arNameAdminValues = { "НСС" /*TEC*/, "Диспетчер" /*GTP*/, "НСС" /*PC*/, "НСС" /*TG*/ };
            string   prefix            = ((modeManager == MANAGER.DISP) || (modeManager == MANAGER.NSS) || (modeManager == MANAGER.LK) || (modeManager == MANAGER.TEPLOSET)) ? @"ПБР" :
                                         (modeManager == MANAGER.ALARM) ? @"Сигн." :
                                         @"Неизвестно";

            switch (modeManager)
            {
            case MANAGER.LK:
                prefix += @" - ЛК";
                break;

            case MANAGER.TEPLOSET:
                prefix += @" - Теплосеть";
                break;

            default:
                prefix += @" - " + arNameAdminValues[(int)modeComponent];
                break;
            }

            return(prefix);
        }
        public static bool Insert(String encrypted, String name)
        {
            //Khởi tạo một đối tượng ACCOUNT
            bool flag = true;
            _db = new FoodStoreEntities();
            try
            {
                var manager = new MANAGER();
                manager.ID = GetMaxId();
                manager.Name = name;
                manager.Encrypted = encrypted;
                _db.MANAGERs.AddObject(manager);

                _db.SaveChanges();
            }
            catch (Exception)
            {
                flag = false;
                throw;
            }

            return flag;
        }
示例#18
0
        /////////////////////
        #region page_Load
        protected void Page_Load(object sender, EventArgs e)
        {
            /////////////////////
            #region UserId_Verify
            userId = (int)(Session["User"]);
            if (userId == 0)
            {
                Response.Redirect("LOGIN_REGISTAR.aspx");
            }
            #endregion
            /////////////////////
            #region Verificação_de_sessão
            if (Session["User"] == null)
            {
                Response.Redirect("HomePage.aspx");
            }
            #endregion
            /////////////////////
            #region Dal_Manager
            /////////////////DAL MANAGER/////////////////////
            MANAGER M = new MANAGER();
            ////////////////////////////////////////////////
            #endregion
            //////////////////////////////////////////
            #region Popular_Dropdown_Lista_Ingredientes

            if (ingredientelista.Items.Count == 0)
            {
                foreach (INGREDIENT Ingrediente in M.listadeIngredientes())
                {
                    ingredientelista.Items.Add(Ingrediente.IngredienteNome);
                }
            }

            #endregion
            //////////////////////////////////////////
            #region Popular_Dropdown_Lista_Categorias
            if (receitaCategoria.Items.Count == 0)
            {
                foreach (CATEGORIA Categoria in M.listadecategorias())
                {
                    receitaCategoria.Items.Add(Categoria.CategoriaNome);
                }
            }
            #endregion
            //////////////////////////////////////////
            #region Popular_Dropdown_Lista_Dificuldade
            if (receitaDificuldade.Items.Count == 0)
            {
                foreach (DIFICULDADE dificuldade in M.listadedificuldades())
                {
                    receitaDificuldade.Items.Add(dificuldade.DificuldadeNome);
                }
            }
            #endregion
            //////////////////////////////////////////
            #region Popular_Dropdown_Lista_Unidade
            if (ingredienteunidade.Items.Count == 0)
            {
                foreach (UNIDADE Unidade in M.listadeUnidades())
                {
                    ingredienteunidade.Items.Add(Unidade.UnidadeNome);
                }
            }
            #endregion
            //////////////////////////////////////////
        }
示例#19
0
 public void AddToMANAGER(MANAGER mANAGER)
 {
     base.AddObject("MANAGER", mANAGER);
 }
示例#20
0
 public static MANAGER CreateMANAGER(int ID, string nAME, string pASSWORD)
 {
     MANAGER mANAGER = new MANAGER();
     mANAGER.ID = ID;
     mANAGER.NAME = nAME;
     mANAGER.PASSWORD = pASSWORD;
     return mANAGER;
 }
示例#21
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                string account = Request.Params.Get("account");
                string password = Request.Params.Get("password");
                if (account == null || password == null)
                {
                    return;
                }

                MANAGER manager;
                try
                {
                    manager = ManagerAccess.GetManagerByName(account);
                }
                catch
                {
                    Response.Write("连接错误,请重新试");
                    Response.End();
                    return;
                }
                if (manager != null)
                {
                    Response.Write("该账号已经存在");
                    Response.End();
                }

                MANAGER newManager = new MANAGER();
                newManager.NAME = account;
                newManager.PASSWORD = password;
                int permissionNum = int.Parse(Request.Params.Get("permission"));

                newManager.MNGR_TYPE = int.Parse(Request.Params.Get("type"));

                if (ManagerAccess.AddManager(newManager))
                {
                    try
                    {
                        newManager = ManagerAccess.GetManagerByName(account);
                        PERMISSION[] allPermission = ManagerAccess.GetAllPermissions();
                        for (int i = 0; permissionNum != 0; i++)
                        {
                            if ((permissionNum & (1 << i)) != 0)
                            {
                                ManagerAccess.GrantPermissionToManager(newManager.ID, allPermission[i].ID);
                                permissionNum -= (1 << i);
                            }
                        }
                    }
                    catch
                    {
                        Response.Write("权限添加失败");
                        Response.End();
                    }
                    Response.Write("success");
                    Response.End();
                }
                else
                {
                    Response.Write("新建管理员失败,请重试");
                    Response.End();
                }
            }
            catch
            {
            }
        }
示例#22
0
 // insert user
 public int InsertUser(MANAGER user)
 {
     db.MANAGERs.Add(user);
     db.SaveChanges();
     return(user.id);
 }
示例#23
0
        /////////////////////
        #region pageload
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                IDreceita = Request.QueryString["IDreceita"];
                /////////////////////
                #region userId_Verify
                if (Session["User"] == null)
                {
                    userId = 0;
                }
                else
                {
                    userId = (int)(Session["User"]);
                }
                ValidateVoto();
                VotoMedia();
                ValidateFAV();
                #endregion
                /////////////////////
                #region ObterReceita_TodoinDALv2.0
                string ligacao = ConfigurationManager.ConnectionStrings["WebsiteReceitasDBcnstr"].ConnectionString;
                ReceitaID = 0;
                #region receberReceita
                using (SqlConnection con = new SqlConnection(ligacao))
                {
                    SqlCommand cmd = new SqlCommand("ObterReceitaEscolhida", con);
                    cmd.CommandType = System.Data.CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@IDreceita", IDreceita);
                    con.Open();
                    using (SqlDataReader reader = cmd.ExecuteReader())
                    {
                        while (reader.Read())
                        {
                            receitanome.Text        = reader["Receita"].ToString();
                            ReceitaDescricao.Text   = reader["Descrição"].ToString();
                            receitaAutor.Text       = reader["Autor"].ToString();
                            receitaCategoria.Text   = reader["Categoria"].ToString();
                            receitaDificuldade.Text = reader["Dificuldade"].ToString();
                            receitaDuracao.Text     = reader["Duração"].ToString();
                            ReceitaID = Int32.Parse(reader["ID"].ToString());
                            byte[] byteData = (byte[])reader["Imagem"];
                            imagemreceita.ImageUrl = "data:image;base64," + Convert.ToBase64String(byteData);
                        }
                    }
                }
                /////////////////////
                #region desespero puro
                MANAGER m    = new MANAGER();
                DataSet ds   = m.GetDataING(ReceitaID);
                DataSet dsCM = m.GetDataCM(ReceitaID);

                GridView1.DataSource = ds;
                GridView1.DataBind();

                Repeater1.DataSource = ds;
                Repeater1.DataBind();

                GridView2.DataSource = dsCM;
                GridView2.DataBind();

                Repeater2.DataSource = dsCM;
                Repeater2.DataBind();
                ////////// O QUE ESTOU EU A FAZER COM A MINHA VIDA? //////////
                #endregion
                /////////////////////
                #endregion
                /////////////////////
                #endregion
                /////////////////////
                #region votodisplay

                if (Convert.ToDouble(votoNum) > 0 && Convert.ToDouble(votoNum) <= 1)
                {
                    ratingimagem.ImageUrl = "~/RESOURCES/IMAGES/RATING/1.png";
                }
                else if (Convert.ToDouble(votoNum) > 1 && Convert.ToDouble(votoNum) <= 2)
                {
                    ratingimagem.ImageUrl = "~/RESOURCES/IMAGES/RATING/2.png";
                }
                else if (Convert.ToDouble(votoNum) > 2 && Convert.ToDouble(votoNum) <= 3)
                {
                    ratingimagem.ImageUrl = "~/RESOURCES/IMAGES/RATING/3.png";
                }
                else if (Convert.ToDouble(votoNum) > 3 && Convert.ToDouble(votoNum) <= 4)
                {
                    ratingimagem.ImageUrl = "~/RESOURCES/IMAGES/RATING/4.png";
                }
                else if (Convert.ToDouble(votoNum) > 4 && Convert.ToDouble(votoNum) <= 5)
                {
                    ratingimagem.ImageUrl = "~/RESOURCES/IMAGES/RATING/5.png";
                }
                #endregion
                /////////////////////
            }
            else
            {
                IDreceita = Request.QueryString["IDreceita"];
                ReceitaID = Convert.ToInt32(IDreceita);
                if (Session["User"] == null)
                {
                    userId = 0;
                }
                else
                {
                    userId = (int)(Session["User"]);
                }
                ValidateVoto();
                ValidateFAV();
            }
        }