Beispiel #1
0
		/// <summary>
		/// 增加一条数据
		/// </summary>
		public int Add(Talent.Model.TB_RC_TalentInfor model)
		{
			StringBuilder strSql=new StringBuilder();
			strSql.Append("insert into TB_RC_TalentInfor(");
            strSql.Append("TI_CB_No,TI_BrandName,TI_TalentClass,TI_Name,TI_Sex,TI_Phone,TI_Src,TI_RecommendPost,TI_Audition,TI_AuditionResult,TI_FollowUpPeople,TI_MaintainDate,TI_MaintainResult,TI_CreatePer,TI_CreateDate,TI_Mark,TI_Work,TI_Industry,TI_Recommend,TI_RecommendDate)");
			strSql.Append(" values (");
            strSql.Append("@TI_CB_No,@TI_BrandName,@TI_TalentClass,@TI_Name,@TI_Sex,@TI_Phone,@TI_Src,@TI_RecommendPost,@TI_Audition,@TI_AuditionResult,@TI_FollowUpPeople,@TI_MaintainDate,@TI_MaintainResult,@TI_CreatePer,@TI_CreateDate,@TI_Mark,@TI_Work,@TI_Industry,@TI_Recommend,@TI_RecommendDate)");
			strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters = {
					new SqlParameter("@TI_CB_No", SqlDbType.Int,4),
					new SqlParameter("@TI_BrandName", SqlDbType.VarChar,100),
					new SqlParameter("@TI_TalentClass", SqlDbType.VarChar,100),
					new SqlParameter("@TI_Name", SqlDbType.VarChar,50),
					new SqlParameter("@TI_Sex", SqlDbType.VarChar,10),
					new SqlParameter("@TI_Phone", SqlDbType.VarChar,100),
					new SqlParameter("@TI_Src", SqlDbType.VarChar,100),
					new SqlParameter("@TI_RecommendPost", SqlDbType.VarChar,100),
					new SqlParameter("@TI_Audition", SqlDbType.VarChar,10),
					new SqlParameter("@TI_AuditionResult", SqlDbType.VarChar,200),
					new SqlParameter("@TI_FollowUpPeople", SqlDbType.VarChar,200),
					new SqlParameter("@TI_MaintainDate", SqlDbType.DateTime),
					new SqlParameter("@TI_MaintainResult", SqlDbType.VarChar,200),
					new SqlParameter("@TI_CreatePer", SqlDbType.VarChar,20),
					new SqlParameter("@TI_CreateDate", SqlDbType.DateTime),
                    new SqlParameter("@TI_Mark", SqlDbType.VarChar,100),
                    new SqlParameter("@TI_Work", SqlDbType.VarChar,1000),
                    new SqlParameter("@TI_Industry", SqlDbType.VarChar,400),
                    new SqlParameter("@TI_Recommend", SqlDbType.VarChar,100),
                    new SqlParameter("@TI_RecommendDate", SqlDbType.DateTime)};
			parameters[0].Value = model.TI_CB_No;
			parameters[1].Value = model.TI_BrandName;
			parameters[2].Value = model.TI_TalentClass;
			parameters[3].Value = model.TI_Name;
			parameters[4].Value = model.TI_Sex;
			parameters[5].Value = model.TI_Phone;
			parameters[6].Value = model.TI_Src;
			parameters[7].Value = model.TI_RecommendPost;
			parameters[8].Value = model.TI_Audition;
			parameters[9].Value = model.TI_AuditionResult;
			parameters[10].Value = model.TI_FollowUpPeople;
			parameters[11].Value = model.TI_MaintainDate;
			parameters[12].Value = model.TI_MaintainResult;
			parameters[13].Value = model.TI_CreatePer;
			parameters[14].Value = model.TI_CreateDate;
            parameters[15].Value = model.TI_Mark;
            parameters[16].Value = model.TI_Work;
            parameters[17].Value = model.TI_Industry;
            parameters[18].Value = model.TI_Recommend;
            parameters[19].Value = model.TI_RecommendDate;
            
            object obj = dbhelp.GetSingle(strSql.ToString(), parameters);
			if (obj == null)
			{
				return 0;
			}
			else
			{
				return Convert.ToInt32(obj);
			}
		}
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(Talent.Model.TB_CG_WelfarePolicyType model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("update TB_CG_WelfarePolicyType set ");
            strSql.Append("WT_WPType=@WT_WPType,");
            strSql.Append("WT_Color=@WT_Color");
            strSql.Append(" where WT_No=@WT_No");
            SqlParameter[] parameters = {
					new SqlParameter("@WT_WPType", SqlDbType.VarChar,100),
					new SqlParameter("@WT_Color", SqlDbType.VarChar,10),
					new SqlParameter("@WT_No", SqlDbType.Int,4)};
            parameters[0].Value = model.WT_WPType;
            parameters[1].Value = model.WT_Color;
            parameters[2].Value = model.WT_No;

            int rows = dbhelp.ExecuteSql(strSql.ToString(), parameters);
            if (rows > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
Beispiel #3
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(Talent.Model.TB_CG_Permission model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("update TB_CG_Permission set ");
            strSql.Append("PM_Login=@PM_Login,");
            strSql.Append("PM_Level=@PM_Level,");
            strSql.Append("PM_Province=@PM_Province");
            strSql.Append(" where PM_No=@PM_No");
            SqlParameter[] parameters = {
					new SqlParameter("@PM_Login", SqlDbType.VarChar,50),
					new SqlParameter("@PM_Level", SqlDbType.Int,4),
					new SqlParameter("@PM_Province", SqlDbType.VarChar,1000),
					new SqlParameter("@PM_No", SqlDbType.Int,4)};
            parameters[0].Value = model.PM_Login;
            parameters[1].Value = model.PM_Level;
            parameters[2].Value = model.PM_Province;
            parameters[3].Value = model.PM_No;

            int rows = dbhelp.ExecuteSql(strSql.ToString(), parameters);
            if (rows > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
Beispiel #4
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(Talent.Model.TB_CG_Permission model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("insert into TB_CG_Permission(");
            strSql.Append("PM_Login,PM_Level,PM_Province)");
            strSql.Append(" values (");
            strSql.Append("@PM_Login,@PM_Level,@PM_Province)");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters = {
					new SqlParameter("@PM_Login", SqlDbType.VarChar,50),
					new SqlParameter("@PM_Level", SqlDbType.Int,4),
					new SqlParameter("@PM_Province", SqlDbType.VarChar,1000)};
            parameters[0].Value = model.PM_Login;
            parameters[1].Value = model.PM_Level;
            parameters[2].Value = model.PM_Province;

            object obj = dbhelp.GetSingle(strSql.ToString(), parameters);
            if (obj == null)
            {
                return 0;
            }
            else
            {
                return Convert.ToInt32(obj);
            }
        }
Beispiel #5
0
		/// <summary>
		/// 增加一条数据
		/// </summary>
		public int Add(Talent.Model.TB_RC_UpkeepDate model)
		{
			StringBuilder strSql=new StringBuilder();
			strSql.Append("insert into TB_RC_UpkeepDate(");
			strSql.Append("UD_CB_No,UD_TI_No,UD_Date,UD_Result,UD_CreatePer,UD_CreateDate)");
			strSql.Append(" values (");
			strSql.Append("@UD_CB_No,@UD_TI_No,@UD_Date,@UD_Result,@UD_CreatePer,@UD_CreateDate)");
			strSql.Append(";select @@IDENTITY");
			SqlParameter[] parameters = {
					new SqlParameter("@UD_CB_No", SqlDbType.Int,4),
					new SqlParameter("@UD_TI_No", SqlDbType.Int,4),
					new SqlParameter("@UD_Date", SqlDbType.DateTime),
					new SqlParameter("@UD_Result", SqlDbType.VarChar,1000),
					new SqlParameter("@UD_CreatePer", SqlDbType.VarChar,20),
					new SqlParameter("@UD_CreateDate", SqlDbType.DateTime)};
			parameters[0].Value = model.UD_CB_No;
			parameters[1].Value = model.UD_TI_No;
			parameters[2].Value = model.UD_Date;
			parameters[3].Value = model.UD_Result;
			parameters[4].Value = model.UD_CreatePer;
			parameters[5].Value = model.UD_CreateDate;

            object obj = dbhelp.GetSingle(strSql.ToString(), parameters);
			if (obj == null)
			{
				return 0;
			}
			else
			{
				return Convert.ToInt32(obj);
			}
		}
Beispiel #6
0
		/// <summary>
		/// 更新一条数据
		/// </summary>
		public bool Update(Talent.Model.TB_RC_TalentClass model)
		{
			StringBuilder strSql=new StringBuilder();
			strSql.Append("update TB_RC_TalentClass set ");
			strSql.Append("TC_Class=@TC_Class,");
			strSql.Append("TC_Color=@TC_Color");
			strSql.Append(" where TC_No=@TC_No");
			SqlParameter[] parameters = {
					new SqlParameter("@TC_Class", SqlDbType.VarChar,100),
					new SqlParameter("@TC_Color", SqlDbType.VarChar,10),
					new SqlParameter("@TC_No", SqlDbType.Int,4)};
			parameters[0].Value = model.TC_Class;
			parameters[1].Value = model.TC_Color;
			parameters[2].Value = model.TC_No;

            int rows = dbhelp.ExecuteSql(strSql.ToString(), parameters);
			if (rows > 0)
			{
				return true;
			}
			else
			{
				return false;
			}
		}
Beispiel #7
0
 public Player()
 {
     name = "Gandalf";
     playerClass = PlayerClass.Mage;
     level = 1;
     expAtual = 0;
     gold = 0;
     attack = 1;
     defense = 1;
     Weapon = new Item();
     Armor = new Item();
     Trinket = new Item();
     Pet = new Item();
     talentLv3 = new Talent();
     talentLv6 = new Talent();
     talentLv9 = new Talent();
     talentLv12 = new Talent();
     talentLv15 = new Talent();
     talentLv18 = new Talent();
     talentLv21 = new Talent();
     talentLv24 = new Talent();
     talentLv27 = new Talent();
     talentLv30 = new Talent();
     LevelExp();
     Eficiences();
     percDecreaseDurationQuest = 0;
     percIncreaseEarnedGold = 0;
 }
Beispiel #8
0
 private void setTalent(Talent c, string tname, string tdescription, bool tmystery, bool treachable, bool tvisible, bool tgotten, Texture2D ticon,
     Rect tpos, int cost, int titemunlock, int tspellunlock, int titemreq, int tspellreq, int unlock1, int unlock2,
     int unlock3, int mystery1, int mystery2, int mystery3, int t)
 {
     c.name = tname; c.description = tdescription; c.mystery = tmystery; c.reachable = treachable; c.gotten = tgotten; c.icon = ticon;
     c.pos = tpos; c.itemUnlock = titemunlock; c.spellUnlock = tspellunlock; c.itemReq = titemreq; c.spellReq = tspellreq;
     c.treeUnlock =  unlock1; c.treeUnlock2 = unlock2; c.treeUnlock3 = unlock3; c.treeMysteryUnlock1 = mystery1; c.treeMysteryUnlock2 = mystery2;
     c.treeMysteryUnlock3 = mystery3; c.visible = tvisible; c.cost = cost; c.tier = t;
 }
        /// <summary>
        ///     Completes the user talent.
        /// </summary>
        /// <param name="session">The session.</param>
        /// <param name="talent">The talent.</param>
        internal void CompleteUserTalent(GameClient session, Talent talent)
        {
            if (session?.GetHabbo() == null || session.GetHabbo().CurrentTalentLevel < talent.Level || session.GetHabbo().Talents.ContainsKey(talent.Id))
                return;

            if (!LevelIsCompleted(session, talent.Type, talent.Level))
                return;

            if (!string.IsNullOrEmpty(talent.Prize) && talent.PrizeBaseItem > 0u)
                Azure.GetGame().GetCatalog().DeliverItems(session, Azure.GetGame().GetItemManager().GetItem(talent.PrizeBaseItem), 1, string.Empty, 0, 0, string.Empty);

            session.GetHabbo().Talents.Add(talent.Id, new UserTalent(talent.Id, 1));

            using (var queryReactor = Azure.GetDatabaseManager().GetQueryReactor())
                queryReactor.RunFastQuery($"REPLACE INTO users_talents VALUES ('{session.GetHabbo().Id}', '{talent.Id}', '1');");

            var serverMessage = new ServerMessage(LibraryParser.OutgoingRequest("TalentLevelUpMessageComposer"));

            serverMessage.AppendString(talent.Type);
            serverMessage.AppendInteger(talent.Level);
            serverMessage.AppendInteger(0);

            if (talent.Type == "citizenship" && talent.Level == 4)
            {
                serverMessage.AppendInteger(2);
                serverMessage.AppendString("HABBO_CLUB_VIP_7_DAYS");
                serverMessage.AppendInteger(7);
                serverMessage.AppendString(talent.Prize);
                serverMessage.AppendInteger(0);
            }
            else
            {
                serverMessage.AppendInteger(1);
                serverMessage.AppendString(talent.Prize);
                serverMessage.AppendInteger(0);
            }

            session.SendMessage(serverMessage);

            if (talent.Type == "citizenship" && talent.Level == 3)
                Azure.GetGame().GetAchievementManager().ProgressUserAchievement(session, "ACH_Citizenship", 1);
            else if (talent.Type == "citizenship" && talent.Level == 4)
            {
                session.GetHabbo().GetSubscriptionManager().AddSubscription(7);

                using (var queryReactor = Azure.GetDatabaseManager().GetQueryReactor())
                    queryReactor.RunFastQuery($"UPDATE users SET talent_status = 'helper' WHERE id = '{session.GetHabbo().Id}'");
            }
        }
Beispiel #10
0
    public static void Main(String[] args)
    {
        String inputFile = "../../../../examples/data/rehearsal.data";
        double tlim = 10.0;
        if (args.Length > 1)
            inputFile = args[1];
        if (args.Length > 2)
            tlim = Double.Parse(args[2]);

        Talent talent = new Talent(inputFile);

        cp.SetParameter(CP.DoubleParam.TimeLimit, tlim);
        cp.Solve();

        talent.Display();
    }
Beispiel #11
0
	private static void IterateTalents(XmlNode xmlNode, ArrayList talents)
	{
		//check for invalid nodes and return
		if (xmlNode == null)
		{
			return;
		}
		
		if(xmlNode.NodeType == XmlNodeType.Comment)
		{
			IterateTalents(xmlNode.NextSibling, talents);
			return;
		}
		
		
		Talent t = new Talent();
		
		t.m_Name = xmlNode.Attributes["name"].Value;
		t.m_Desc = xmlNode.Attributes["desc"].Value;
		t.m_ImgName = xmlNode.Attributes["img"].Value;
		if(xmlNode.Attributes["cost"] != null)
		t.m_Cost = int.Parse(xmlNode.Attributes["cost"].Value);
		
		string stats = xmlNode.Attributes["stats"].Value;
		char[] delimiters = {',' , ' '};
		string[] splitStats = stats.Split(delimiters);
		//this iterates over each string value pair for the stats attributes
		for(int i = 0; i < splitStats.Length; i+=2)
		{
			//parse the stat name and the stat value
			char [] delimiters2 = {':'};
			string [] pair = splitStats[i].Split(delimiters2);
			t.m_Stats.Add(pair[0],int.Parse(pair[1]));
			Debug.Log(pair[0]+" "+pair[1]);
		}
		m_Talents.Add(t);
		//XmlNodeList childNodes = xmlNode.ChildNodes;
		//XmlNode childNode = null;
	
		//for (int i = 0; i < childNodes.Count; ++i)
		//{
		//}
		IterateTalents(xmlNode.NextSibling, talents);
	}
Beispiel #12
0
        // GET
        public Talent getTalentById(int talentId)
        {
            try
            {
                Talent talent = new Talent();

                // Step #1 - Connect to the DB
                string        connStr = configuration.GetConnectionString("MyConnStr");
                SqlConnection conn    = new SqlConnection(connStr);
                conn.Open();

                // Step #2 - Create a command
                string     query = "SELECT * FROM dbo.Talent WHERE TalentId = @talentId;";
                SqlCommand cmd   = new SqlCommand(query, conn);
                cmd.Parameters.AddWithValue("@talentId", talentId);

                // Step #3 - query the DB
                SqlDataReader reader = cmd.ExecuteReader();
                reader.Read();

                talent.TalentId    = talentId;
                talent.TalentName  = reader["talentName"].ToString();
                talent.TalentTitle = reader["talentTitle"].ToString();
                talent.TalentDesc  = reader["talentDesc"].ToString();
                talent.ImageURL    = reader["imageURL"].ToString();
                talent.CreatedDate = Convert.ToDateTime(reader["CreatedDate"].ToString());
                talent.CreatedBy   = reader["createdBy"].ToString();
                talent.UpdatedDate = Convert.ToDateTime(reader["UpdatedDate"].ToString());
                talent.UpdatedBy   = reader["updatedBy"].ToString();

                // Step #4 - close the connection
                conn.Close();
                return(talent);
            }
            catch (Exception ex)
            {
                Console.WriteLine("--INTERNAL ERROR GETTING TALENT BY ID!!--, " + ex);
                Talent talent = new Talent(); // will be null
                return(talent);
            }
        }
Beispiel #13
0
        /// <summary>
        ///     Completes the user talent.
        /// </summary>
        /// <param name="session">The session.</param>
        /// <param name="talent">The talent.</param>
        internal void CompleteUserTalent(GameClient session, Talent talent)
        {
            if (session?.GetHabbo() == null || session.GetHabbo().CurrentTalentLevel < talent.Level || session.GetHabbo().Talents.ContainsKey(talent.Id))
            {
                return;
            }

            if (!LevelIsCompleted(session, talent.Type, talent.Level))
            {
                return;
            }

            if (!string.IsNullOrEmpty(talent.Prize) && talent.PrizeBaseItem > 0u)
            {
                Yupi.GetGame().GetCatalog().DeliverItems(session, Yupi.GetGame().GetItemManager().GetItem(talent.PrizeBaseItem), 1, string.Empty, 0, 0, string.Empty);
            }

            session.GetHabbo().Talents.Add(talent.Id, new UserTalent(talent.Id, 1));

            using (IQueryAdapter queryReactor = Yupi.GetDatabaseManager().GetQueryReactor())
                queryReactor.RunFastQuery($"REPLACE INTO users_talents VALUES ('{session.GetHabbo().Id}', '{talent.Id}', '1');");

            session.SendMessage(AchievementTalentComposer.Compose(session, talent));

            if (talent.Type == "citizenship")
            {
                switch (talent.Level)
                {
                case 3:
                    Yupi.GetGame().GetAchievementManager().ProgressUserAchievement(session, "ACH_Citizenship", 1);
                    break;

                case 4:
                    session.GetHabbo().GetSubscriptionManager().AddSubscription(7);

                    using (IQueryAdapter queryReactor = Yupi.GetDatabaseManager().GetQueryReactor())
                        queryReactor.RunFastQuery($"UPDATE users SET talent_status = 'helper' WHERE id = '{session.GetHabbo().Id}'");
                    break;
                }
            }
        }
Beispiel #14
0
    public void DisplayAbilities(Job job)
    {
        ClearTalentButtons();

        currentJob = job;

        jobName.text        = job.Name;
        jobDescription.text = job.descript;
        PrintJobLabel(job);



        foreach (Discipline disc in currentJob.avalibleDisciples)
        {
            //  Button discButton = Instantiate<Button>(jobButton, talentContainer);
            //discButton.transform.GetChild(0).GetComponent<Text>().text = "Discipline: " + disc.Name;
            //talentButtons.Add(discButton);

            foreach (string key in disc.TalenPool)
            {
                Talent skill = Globals.campaign.contentLibrary.TalentDB.GetCopy(key);

                TextButton temp = Instantiate <TextButton>(jobButton, talentContainer.contentTransform);
                temp.ChangeText(skill.TalentNodename);
                talentButtons.Add(temp);

                temp.button.onClick.AddListener(delegate { TalentClicked(skill); });

                if (currActor.JobDataState.SkillLearned(currentJob.GetKey(), skill.GetKey()) == true)
                {
                    temp.button.interactable = false;
                }
            }
        }
        talentContainer.AdjustContentLength();

        if (talentButtons.Count > 0)
        {
            talentButtons[0].button.onClick.Invoke();
        }
    }
Beispiel #15
0
        public void SaveWorkExperienceTest()
        {
            ////不存在的欄位
            var input1    = TestData.GetInstance().TestWorkExperienceData1();
            var expected1 = "儲存失敗";
            var actual1   = Talent.GetInstance().SaveWorkExperience(input1, "2");

            Assert.AreEqual(expected1, actual1);
            ////沒有對應的面試ID
            var input2    = TestData.GetInstance().TestWorkExperienceData();
            var expected2 = "沒有對應的面試基本資料";
            var actual2   = Talent.GetInstance().SaveWorkExperience(input2, "AA");

            Assert.AreEqual(expected2, actual2);

            var input    = TestData.GetInstance().TestWorkExperienceData();
            var expected = "儲存成功";
            var actual   = Talent.GetInstance().SaveWorkExperience(input, "2");

            Assert.AreEqual(expected, actual);
        }
        public async Task <ActionResult <Talent> > PostTalent(Talent talent)
        {
            _context.Talent.Add(talent);
            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateException)
            {
                if (TalentExists(talent.Id))
                {
                    return(Conflict());
                }
                else
                {
                    throw;
                }
            }

            return(CreatedAtAction("GetTalent", new { id = talent.Id }, talent));
        }
Beispiel #17
0
        public ActionResult <TalentProjectsAndCategoriesEditVM> Index()
        {
            try
            {
                var    curUser = accountUtil.GetCurrentUser(User);
                Talent model   = TalentService.GetByUserID(curUser.ID);
                if (model == null)
                {
                    throw new Exception("Талант не найден");
                }

                TalentProjectsAndCategoriesEditVM modelVM =
                    new TalentProjectsAndCategoriesEditVM(model);

                return(Ok(modelVM));
            }
            catch (Exception ex)
            {
                return(CustomBadRequest(ex));
            }
        }
 private void SetMainInformation(Talent talent)
 {
     isActive = true;
     gameObject.SetActive(true);
     if (slideAnim != null)
     {
         slideAnim.Play("Slide_DescriptionPanel");
     }
     toxicity.text    = "<color='lime'>Toxicity</color>: " + talent.characteristics.toxicity.ToString() + " %";
     cures.text       = "<color='red'>Cures </color>: " + talent.cures;
     healingRate.text = "<color='red'>Healing</color>: " + talent.characteristics.healingRate.ToString();
     if (talent.isPrimary)
     {
         type.text = "<color='orange'>Primary</color>";
     }
     else
     {
         type.text = "<color='orange'>Secondary</color>";
     }
     Nametxt.text = talent.description.Name;
 }
        public IHttpActionResult GetTalent(int id, string employeeId)
        {
            Talent talent = default(Talent);

            using (var ctx = SharePointOnlineHelper.GetElevatedContext())
            {
                var list  = ctx.Web.Lists.GetByTitle(ConfigurationManager.AppSettings["listName"]);
                var query = new CamlQuery();
                query.ViewXml = KTPConstants.Get_Talent_Record_By_EmployeeId_Query.Replace("EMP_ID", employeeId);
                var result = list.GetItems(query);
                ctx.Load(result);
                ctx.ExecuteQuery();
                talent = Talent.FromSPListItem(result[0]);
                if (result.ToList().Count >= 2)
                {
                    talent.PreviousYear = PreviousYearRating.FromSPListItem(result[1]);
                }
            }

            return(Ok(talent));
        }
Beispiel #20
0
    //double OR requisite talent constructor with tooltip
    public Talent(string newName, int levelRequirement, Talent newRequisiteOne, Talent newRequisiteTwo, int newMax, string description)
    {
        name         = newName;
        requisiteOne = newRequisiteOne;
        requisiteTwo = newRequisiteTwo;

        minLevel = levelRequirement;

        UpdateTalentRequisites(1);

        if (newMax > 0)
        {
            maxPoints = newMax;
        }
        else
        {
            maxPoints = 1;
        }

        tooltip = description;
    }
Beispiel #21
0
        private void UpdateTalentProjects(Talent model, List <string> projectNames)
        {
            if (projectNames == null || projectNames.Count == 0)
            {
                model.Projects = new List <TalentProject>();
                return;
            }

            model.Projects.Clear();

            foreach (var name in projectNames)
            {
                if (!string.IsNullOrWhiteSpace(name))
                {
                    model.Projects.Add(new TalentProject()
                    {
                        Name = name
                    });
                }
            }
        }
Beispiel #22
0
    // Build Talent Info Panels + Get Data
    #region
    public Talent GetTalentByName(CharacterData character, string talentName)
    {
        Debug.Log("TalentController.GetTalentByName() called, searching for " + talentName);
        Talent talentReturned = null;

        foreach (Talent talent in character.allTalentButtons)
        {
            if (talent.name == talentName)
            {
                talentReturned = talent;
                break;
            }
        }

        if (talentReturned == null)
        {
            Debug.Log("TalentController.GetTalentByName() could not find a talent with the name " + talentName + ", returning null");
        }

        return(talentReturned);
    }
Beispiel #23
0
    public static void Main(String[] args)
    {
        String inputFile = "../../../../examples/data/rehearsal.data";
        double tlim      = 10.0;

        if (args.Length > 1)
        {
            inputFile = args[1];
        }
        if (args.Length > 2)
        {
            tlim = Double.Parse(args[2]);
        }

        Talent talent = new Talent(inputFile);

        cp.SetParameter(CP.DoubleParam.TimeLimit, tlim);
        cp.Solve();

        talent.Display();
    }
Beispiel #24
0
        private void UpdateTalentCategories(Talent model, List <int> selectedCategories)
        {
            if (selectedCategories == null || selectedCategories.Count == 0)
            {
                model.TalentCategories = new List <TalentCategory>();
                return;
            }

            HashSet <int> selectedCategoriesHS = new HashSet <int>(selectedCategories);
            HashSet <int> talentCategories     = new HashSet <int>(model.TalentCategories
                                                                   .Select(m => m.CategoryId));

            List <Category> allCategories = CategoryService.GetAllActive().ToList();

            foreach (var category in allCategories)
            {
                if (selectedCategoriesHS.Contains(category.ID))
                {
                    if (!talentCategories.Contains(category.ID))
                    {
                        model.TalentCategories.Add(new TalentCategory()
                        {
                            Category = category,
                            Talent   = model
                        });
                    }
                }
                else
                {
                    if (talentCategories.Contains(category.ID))
                    {
                        var cat = model.TalentCategories.FirstOrDefault(m => m.CategoryId == category.ID);
                        if (cat != null)
                        {
                            model.TalentCategories.Remove(cat);
                        }
                    }
                }
            }
        }
Beispiel #25
0
    private void InitData()
    {
        if (EntityWorld.Instance.EntSelf == null)
        {
            Debug.LogError("EntityWorld.Instance.EntSelf is null !!!");
            return;
        }
        if (this.listProfessionTalent == null)
        {
            this.listProfessionTalent = new List <Talent>();
        }
        this.listProfessionTalent.Clear();
        List <Talent> dataList = DataReader <Talent> .DataList;

        for (int i = 0; i < dataList.get_Count(); i++)
        {
            Talent talent = dataList.get_Item(i);
            if (talent.job == EntityWorld.Instance.EntSelf.TypeID)
            {
                this.listProfessionTalent.Add(talent);
            }
        }
        if (this.zoneToTalent == null)
        {
            this.zoneToTalent = new Dictionary <int, List <int> >();
        }
        this.zoneToTalent.Clear();
        for (int j = 0; j < this.listProfessionTalent.get_Count(); j++)
        {
            Talent talent2 = this.listProfessionTalent.get_Item(j);
            if (!this.zoneToTalent.ContainsKey(talent2.minRoleLv))
            {
                this.zoneToTalent.set_Item(talent2.minRoleLv, new List <int>());
            }
            if (!this.zoneToTalent.get_Item(talent2.minRoleLv).Contains(talent2.id))
            {
                this.zoneToTalent.get_Item(talent2.minRoleLv).Add(talent2.id);
            }
        }
    }
Beispiel #26
0
        public static void Update()
        {
            // Keep the frame stuck so we can do a bunch of injecting at once.
            using (StyxWoW.Memory.AcquireFrame())
            {
                CurrentSpec = StyxWoW.Me.Specialization;
                Logger.Write("TalentManager - looks like a {0}", CurrentSpec.ToString());

                Talents.Clear();

                // Always 18 talents. 6 rows of 3 talents.
                for (int index = 1; index <= 6 * 3; index++)
                {
                    var selected =
                        Lua.GetReturnVal <bool>(
                            string.Format(
                                "local t= select(5,GetTalentInfo({0})) if t == true then return 1 end return nil", index),
                            0);
                    var t = new Talent {
                        Index = index, Selected = selected
                    };
                    Talents.Add(t);
                }

                Glyphs.Clear();

                // 6 glyphs all the time. Plain and simple!
                for (int i = 1; i <= 6; i++)
                {
                    List <string> glyphInfo = Lua.GetReturnValues(String.Format("return GetGlyphSocketInfo({0})", i));

                    // add check for 4 members before access because empty sockets weren't returning 'nil' as documented
                    if (glyphInfo != null && glyphInfo.Count >= 4 && glyphInfo[3] != "nil" &&
                        !string.IsNullOrEmpty(glyphInfo[3]))
                    {
                        Glyphs.Add(WoWSpell.FromId(int.Parse(glyphInfo[3])).Name.Replace("Glyph of ", ""));
                    }
                }
            }
        }
        public Enrollment CreateEnrollment(string userId, int instituteId)
        {
            ApplicationUser user      = repository.GetUser(userId).Result;
            Institute       institute = repository.GetInstitute(instituteId).Result;

            //inicializamos recursos
            Resource resource = repository.SaveResource(new Resource()).Result;

            //inicializamos software
            Software software = repository.SaveSoftware(new Software()).Result;

            //inicializamos talentos
            Talent talent = repository.SaveTalent(new Talent()).Result;

            //inicializamos scripts de ataque
            Script script = repository.SaveScript(new Script()).Result;

            //TODO: inicializamos profesores

            //creamos la matrícula
            Enrollment enrollment = repository.SaveEnrollment(new Enrollment(user, institute)).Result;

            //inicializamos el ordenador
            Computer computer = new Computer(
                string.Format("Ordenador de {0}", user.UserName),
                generatePosition(instituteId),
                true,
                resource,
                software,
                talent,
                script,
                enrollment);

            computer = repository.SaveComputer(computer).Result;

            CreateWelcomeMessage(institute, computer);

            return(enrollment);
        }
Beispiel #28
0
    // Start is called before the first frame update
    void Start()
    {
        Beautymon bebisel = Beautymon.load("Bebisel");

        bebisel.setTalent("Sturdy");
        bebisel.setMoves(new List <string>()
        {
            "Scratch"
        });
        Beautymon potus = Beautymon.load("Potus");

        potus.setTalent(Talent.load("Flash Fire"));
        potus.setMoves(new List <Move>()
        {
            Move.load("Ember"), Move.load("Growl"), Move.load("Scratch"), Move.load("Zenith")
        });

        displayMoves(potus);

        useMove(potus, bebisel, potus.moves[0]);
        useMove(bebisel, potus, bebisel.moves[0]);
    }
Beispiel #29
0
        public IActionResult PostTalent(Talent talent)
        {
            Talent newT = new Talent();

            newT.Name      = talent.Name;
            newT.ShortName = talent.ShortName;
            newT.Profile   = talent.Profile;
            newT.Bio       = talent.Bio;
            newT.Reknown   = talent.Reknown;

            try
            {
                _rdsContext.Add(newT);
                _rdsContext.SaveChanges();
            }
            catch
            {
                return(BadRequest());
            }

            return(Ok());
        }
Beispiel #30
0
        public IActionResult GetTalentById(int id)
        {
            Talent t = _rdsContext.Talents.SingleOrDefault(x => x.Id == id);

            if (t == null)
            {
                return(BadRequest());
            }
            object result = new object();

            result = new
            {
                id        = t.Id,
                name      = t.Name,
                shortName = t.ShortName,
                profile   = t.Profile,
                bio       = t.Bio,
                reknown   = t.Reknown
            };

            return(new JsonResult(result));
        }
Beispiel #31
0
    private bool SelectedTalentsContain(Talent talent)
    {
        int counter = 0;

        foreach (Talent t in selectedTalents)
        {
            if (t == talent)
            {
                counter++;
            }
        }

        if (counter > 0)
        {
            return(true);
        }

        else
        {
            return(false);
        }
    }
Beispiel #32
0
        public void Test_SaveAndDeleteCharacterTalent()
        {
            bool returnVal;
            int  CharacterID = 1;
            int  TalentID    = 50;

            Talent objTalent  = new Talent();
            Talent objTalent2 = new Talent();

            objTalent.GetTalent(TalentID);
            objTalent2.SaveCharacterTalent(CharacterID, TalentID);

            List <Talent> lstTalent = new List <Talent>();

            lstTalent = objTalent.GetCharacterTalents(CharacterID);

            Assert.IsTrue(Talent.IsTalentInList(objTalent, lstTalent));

            returnVal = objTalent.DeleteCharacterTalent(CharacterID, TalentID);

            Assert.IsTrue(returnVal && objTalent.DeleteOK);
        }
Beispiel #33
0
        public Player(double x, double y, ushort agentPort, Talent talent, bool isPlayBack) :
            base(x, y)
        {
            this.isPlayBack = isPlayBack;
            if (!isPlayBack)
            {
                ClientCommunication.Initialize();
                ClientCommunication.ReceiveMessage += OnReceive;
                ClientCommunication.ConnectServer(new IPEndPoint(IPAddress.Loopback, agentPort));
            }
            playerTalent = talent;

            if (isPlayBack)
            {
                Reader = new PlayBack.Reader("server.playback");
                PlayBack();
            }
            else
            {
                new Thread(Operation).Start();
            }
        }
Beispiel #34
0
        public void SelectIdByContactTest()
        {
            var expected = 2;
            var actual   = Talent.GetInstance().SelectIdByContact(string.Empty, "C#,JAVA", string.Empty, string.Empty, "2017-12-15", "2018-01-01").Count;

            Assert.AreEqual(expected, actual);

            var expected1 = 2;
            var actual1   = Talent.GetInstance().SelectIdByContact(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty).Count;

            Assert.AreEqual(expected1, actual1);

            var expected2 = 1;
            var actual2   = Talent.GetInstance().SelectIdByContact(string.Empty, string.Empty, "合約", string.Empty, string.Empty, string.Empty).Count;

            Assert.AreEqual(expected2, actual2);

            var expected3 = 2;
            var actual3   = Talent.GetInstance().SelectIdByContact(string.Empty, string.Empty, "不限", string.Empty, string.Empty, string.Empty).Count;

            Assert.AreEqual(expected3, actual3);
        }
Beispiel #35
0
    public void ResetTalent(Talent talent)
    {
        selectedTalents.Remove(talent);
        talent.isSelected = false;
        GameObject toInstantiate = Instantiate(view.elementInList, view.talentsListView);

        toInstantiate.GetComponentInChildren <CraftHolder>().Talent = talent;
        Recombine(selectedTalents);
        if (selectedTalents.Count == 0)
        {
            view.DisableAllParticles();
            view.ResetCraftButton();
        }
        else if (selectedTalents.Where(x => x.isPrimary).ToList().Count > 0)
        {
            view.ReflectMatch(MatchTalents());
        }
        else
        {
            view.DisableAllParticles(); view.ResetCraftButton();
        }
    }
Beispiel #36
0
        /// <summary>
        /// 登入動作
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SignInBtn_Click(object sender, EventArgs e)
        {
            string account  = AccountTxt.Text;
            string password = PasswordTxt.Text;

            Msg = Talent.GetInstance().SignIn(account, password);
            if (!string.IsNullOrEmpty(Talent.GetInstance().ErrorMessage))
            {
                MessageBox.Show(Talent.GetInstance().ErrorMessage);
                return;
            }

            if (Msg != "登入失敗" && Msg != "該帳號停用中")
            {
                this.DialogResult = DialogResult.OK;
                this.Hide();
            }
            else
            {
                MessageBox.Show(Msg, "錯誤訊息");
            }
        }
Beispiel #37
0
        public void Put(int inputId, Talent inputTalent)
        {
            PropertyInfo[] targetProp = typeof(Talent)
                                        .GetProperties()
                                        .Where(
                p => p.GetValue(inputTalent, null) != null
                )
                                        .ToArray();

            Talent[] query = talents
                             .Where(x => x.Id == inputId)
                             .Select(x =>
            {
                foreach (PropertyInfo property in targetProp)
                {
                    property.SetValue(x, property.GetValue(inputTalent, null));
                }
                return(x);
            }
                                     )
                             .ToArray();
        }
Beispiel #38
0
    private void refreshTalentMarket()
    {
        int needCount = 0;

        foreach (Talent talent in talentList)
        {
            if (talent.isHired)   //skip the hired people
            {
                ++needCount;
            }
            else     //not hired people, need to be refreshed
            {
                Talent.refreshTalent(talent);
            }
        }
        //add new talent
        for (int i = talentList.Count; i < talentList.Count + needCount; ++i)
        {
            talentList.Add(Talent.generateTalent());
            talentList[i].id = i;
        }
    }
Beispiel #39
0
        public TalentLevelUpComposer(Talent talent)
            : base(ServerPacketHeader.TalentLevelUpMessageComposer)
        {
            WriteString(talent.Type);
            WriteInteger(talent.Level);
            WriteInteger(0);

            if (talent.Type == "citizenship" && talent.Level == 4)
            {
                WriteInteger(2);
                WriteString("HABBO_CLUB_VIP_7_DAYS");
                WriteInteger(7);
                WriteString(talent.Prize);
                WriteInteger(0);
            }
            else
            {
                WriteInteger(1);
                WriteString(talent.Prize);
                WriteInteger(0);
            }
        }
Beispiel #40
0
        private void ViewTalentDescription(string talent)
        {
            string talentToView = talent.Replace("view ", string.Empty);

            Talent foundTalent = this.talents.Find(s => s.Name.Equals(talentToView, StringComparison.CurrentCultureIgnoreCase));

            if (foundTalent != null)
            {
                var sb = new StringBuilder();
                sb.Append("<%b%><%yellow%>=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=" + Environment.NewLine);
                sb.AppendFormat("Description for {0}" + Environment.NewLine, foundTalent.Name);
                sb.Append("=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=<%n%>" + Environment.NewLine);
                sb.Append("<%b%><%white%>" + foundTalent.Description + Environment.NewLine);
                sb.Append("<%b%><%yellow%>=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=<%n%>");

                this.Session.Write(sb.ToString());
            }
            else
            {
                WrmChargenCommon.SendErrorMessage(this.Session, "That talent does not exist.");
            }
        }
Beispiel #41
0
        public void Initialize(Talent talent)
        {
            Talent            = talent;
            Talent.Learned   += OnTalentLearned;
            Talent.Unlearned += OnTalentUnlearned;

            this.hover.PointerEnter += OnInteractablePointerEnter;
            this.hover.PointerExit  += OnInteractablePointerExit;
            this.hover.PointerUp    += OnInteractablePointerUp;

            this.icon.sprite = Resources.Load <Sprite>(Talent.Icon);
            this.text.text   = talent.Name;

            if (Talent.IsLearned)
            {
                OnTalentLearned(Talent);
            }
            else
            {
                OnTalentUnlearned(Talent);
            }
        }
Beispiel #42
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(Talent.Model.TB_CG_CityBase model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("insert into TB_CG_CityBase(");
            strSql.Append("CB_Des,CB_Name,cb_shopnum,CB_Num,cb_setup,CB_Je,CB_X,CB_Y)");
            strSql.Append(" values (");
            strSql.Append("@CB_Des,@CB_Name,@cb_shopnum,@CB_Num,@cb_setup,@CB_Je,@CB_X,@CB_Y)");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters = {
					new SqlParameter("@CB_Des", SqlDbType.Text),
					new SqlParameter("@CB_Name", SqlDbType.VarChar,100),
					new SqlParameter("@cb_shopnum", SqlDbType.VarChar,400),
					new SqlParameter("@CB_Num", SqlDbType.Int,4),
					new SqlParameter("@cb_setup", SqlDbType.DateTime),
					new SqlParameter("@CB_Je", SqlDbType.VarChar,50),
					new SqlParameter("@CB_X", SqlDbType.VarChar,400),
                    new SqlParameter("@CB_Y", SqlDbType.VarChar,400)};
					 
            parameters[0].Value = model.CB_Des;
            parameters[1].Value = model.CB_Name;
            parameters[2].Value = model.cb_shopnum;
            parameters[3].Value = model.CB_Num;
            parameters[4].Value = model.cb_setup;
            parameters[5].Value = model.CB_Je;
            parameters[6].Value = model.CB_X;
            parameters[7].Value = model.CB_Y;
            
 
            object obj = dbhelp.GetSingle(strSql.ToString(), parameters);
            if (obj == null)
            {
                return 0;
            }
            else
            {
                return Convert.ToInt32(obj);
            }
        }
Beispiel #43
0
		/// <summary>
		/// 更新一条数据
		/// </summary>
		public bool Update(Talent.Model.TB_RC_UpkeepDate model)
		{
			StringBuilder strSql=new StringBuilder();
			strSql.Append("update TB_RC_UpkeepDate set ");
			strSql.Append("UD_CB_No=@UD_CB_No,");
			strSql.Append("UD_TI_No=@UD_TI_No,");
			strSql.Append("UD_Date=@UD_Date,");
			strSql.Append("UD_Result=@UD_Result,");
			strSql.Append("UD_CreatePer=@UD_CreatePer,");
			strSql.Append("UD_CreateDate=@UD_CreateDate");
			strSql.Append(" where UD_No=@UD_No");
			SqlParameter[] parameters = {
					new SqlParameter("@UD_CB_No", SqlDbType.Int,4),
					new SqlParameter("@UD_TI_No", SqlDbType.Int,4),
					new SqlParameter("@UD_Date", SqlDbType.DateTime),
					new SqlParameter("@UD_Result", SqlDbType.VarChar,1000),
					new SqlParameter("@UD_CreatePer", SqlDbType.VarChar,20),
					new SqlParameter("@UD_CreateDate", SqlDbType.DateTime),
					new SqlParameter("@UD_No", SqlDbType.Int,4)};
			parameters[0].Value = model.UD_CB_No;
			parameters[1].Value = model.UD_TI_No;
			parameters[2].Value = model.UD_Date;
			parameters[3].Value = model.UD_Result;
			parameters[4].Value = model.UD_CreatePer;
			parameters[5].Value = model.UD_CreateDate;
			parameters[6].Value = model.UD_No;

            int rows = dbhelp.ExecuteSql(strSql.ToString(), parameters);
			if (rows > 0)
			{
				return true;
			}
			else
			{
				return false;
			}
		}
Beispiel #44
0
		/// <summary>
		/// 增加一条数据
		/// </summary>
		public int Add(Talent.Model.TB_RC_TalentClass model)
		{
			StringBuilder strSql=new StringBuilder();
			strSql.Append("insert into TB_RC_TalentClass(");
			strSql.Append("TC_Class,TC_Color)");
			strSql.Append(" values (");
			strSql.Append("@TC_Class,@TC_Color)");
			strSql.Append(";select @@IDENTITY");
			SqlParameter[] parameters = {
					new SqlParameter("@TC_Class", SqlDbType.VarChar,100),
					new SqlParameter("@TC_Color", SqlDbType.VarChar,10)};
			parameters[0].Value = model.TC_Class;
			parameters[1].Value = model.TC_Color;

            object obj = dbhelp.GetSingle(strSql.ToString(), parameters);
			if (obj == null)
			{
				return 0;
			}
			else
			{
				return Convert.ToInt32(obj);
			}
		}
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(Talent.Model.TB_CG_WelfarePolicyType model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("insert into TB_CG_WelfarePolicyType(");
            strSql.Append("WT_WPType,WT_Color)");
            strSql.Append(" values (");
            strSql.Append("@WT_WPType,@WT_Color)");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters = {
					new SqlParameter("@WT_WPType", SqlDbType.VarChar,100),
					new SqlParameter("@WT_Color", SqlDbType.VarChar,10)};
            parameters[0].Value = model.WT_WPType;
            parameters[1].Value = model.WT_Color;

            object obj = dbhelp.GetSingle(strSql.ToString(), parameters);
            if (obj == null)
            {
                return 0;
            }
            else
            {
                return Convert.ToInt32(obj);
            }
        }
Beispiel #46
0
    public MedicFactory()
    {
        baseModel = Resources.Load<GameObject>("MedicModel");

        attackPower = 0.9f;
        armor = 0.2f;
        maxHP = 4*2;
        maxMP = 6;

        baseSkills.Add(SkillFactory.GetHeal());
        baseSkills.Add(SkillFactory.GetAoEHeal());
        baseSkills.Add(SkillFactory.GetWeakenOffense());

        Talent t = new Talent();
        t.name = "Anatomy";
        t.description = "Medic learns the Anatomy Skill. Provides a huge damage buff to a single target.";
        t.IfChosen = unit =>
        {
            unit.AddSkill(SkillFactory.getAnatomy());
        };
        talentOptions.Add(t);

        t = new Talent();
        t.name = "Med Station";
        t.description = "Can deploy a med station, which passively heals allies around it";
        t.IfChosen = unit =>
        {
            unit.AddSkill(SkillFactory.getMakeMedStation());
        };
        talentOptions.Add(t);

        t = new Talent();
        t.name = "Blood Donor";
        t.description = "Medic learns the Blood Donor Skill. The medic siphons the hitpoints of his target.";
        t.IfChosen = unit => {
            unit.AddSkill(SkillFactory.GetBloodDonor());
        };
        talentOptions.Add(t);

        t = new Talent();
        t.name = "Balance";
        t.description = "Heal now damages a nearby enemy in addition to healing the target. It also siphons the enemy's armor.";
        t.IfChosen = unit =>
        {
            unit.talentTags.Add("Balance");
        };
        talentOptions.Add(t);

        t = new Talent();
        t.name = "Lethal Injection";
        t.description = "Medic gains Lethal Injection, a single target attack that slightly lowers the target's armor and damage";
        t.IfChosen = unit =>
        {
            unit.AddSkill(SkillFactory.getLethalInjection());
        };
        talentOptions.Add(t);

        t = new Talent();
        t.name = "Oath Breaker";
        t.description = "AOE heal now deals damage instead";
        t.IfChosen = unit =>
        {
            unit.talentTags.Add("OathBreaker");
        };
        talentOptions.Add(t);

        name = "Medic";
        description = "A doctor who supports his team with his healing powers.";
        image = Resources.Load<Sprite>("CharacterIcons/MedicIcon");
    }
Beispiel #47
0
    /// <summary>
    /// Handles Removing a Talent Point
    /// Removes a point from the passed talent, adds the point back to the unused talent pool, and removes the ability attached to the talent if removing a point will zero out the talent.
    /// If removing a point from this talent does means that talents at lower depths will not have enough points above them to be valid, a point will not be removed from this talent. 
    /// </summary>
    /// <param name="talent">The talent to remove a point from.</param>
    public void RemovePoint(Talent talent)
    {
        if (talent.CurrentPoints > 0)
        {

            if (mightTree.Contains(talent) == true)
            {

                foreach (Talent t in mightTree)
                {
                    if (t.Depth > talent.Depth && t.CurrentPoints > 0)
                    {
                        if ((mightTreePoints - 1) <= t.Depth * depthMultiplier)
                        {
                            return;
                        }
                    }
                }

                mightTreePoints--;
            }
            else if (magicTree.Contains(talent) == true)
            {

                foreach (Talent t in magicTree)
                {
                    if (t.Depth > talent.Depth && t.CurrentPoints > 0)
                    {
                        if ((magicTreePoints - 1) <= t.Depth * depthMultiplier)
                        {
                            return;
                        }
                    }
                }

                magicTreePoints--;
            }

            talentPointPool++;
            talent.CurrentPoints--;

            if (talent.CurrentPoints == 0)
            {
                if (talent.TalentAbility != null)
                {
                    RemoveAbility(talent);
                }
                else if (talent.Bonus != "")
                {
                    RemovePassive(talent);
                }
            }
        }
    }
 public void Load(Talent t)
 {
     this.DataContext = t;
     //BitmapImage image = new BitmapImage(new Uri("", UriKind.Absolute));
     //talentIcon.Source = image;
 }
Beispiel #49
0
    /// <summary>
    /// Handles spending a talent point. 
    /// Adds the ability tied to the passed talent, increments the number of points spent on that talent and
    /// the number of points spent in that talent's tree, and decrements the number of unused talent points.
    /// </summary>
    /// <param name="talent">The talent to spend the point on.</param>
    public void SpendPoint(Talent talent)
    {
        if (talentPointPool > 0 && talent.CurrentPoints < talent.MaxPoints && IsTalentActive(talent) == true)
        {

            talentPointPool--;
            talent.CurrentPoints++;

            if (mightTree.Contains(talent) == true)
            {
                mightTreePoints++;
            }
            else if (magicTree.Contains(talent) == true)
            {
                magicTreePoints++;
            }

            if (talent.TalentAbility != null)
            {
                AddAbility(talent);
            }
            else if(talent.Bonus != "")
            {
                AddPassive(talent);
            }
        }
    }
Beispiel #50
0
 /// <summary>
 /// Adds a talent's ability to the player's spellbook if it is not already present.
 /// </summary>
 /// <param name="talent">The talent to add.</param>
 private void AddAbility(Talent talent)
 {
     if (playerController.SpellBook.Contains(talent.TalentAbility) == false)
     {
         playerController.SpellBook.Add(talent.TalentAbility);
     }
 }
Beispiel #51
0
 /// <summary>
 /// Removes a talent's ability from the player's spellbook if it is present.
 /// </summary>
 /// <param name="talent"></param>
 private void RemoveAbility(Talent talent)
 {
     if (playerController.SpellBook.Contains(talent.TalentAbility) == true)
     {
         playerController.SpellBook.Remove(talent.TalentAbility);
     }
     else if (playerController.entity.abilityManager.abilities.Contains(talent.TalentAbility))
     {
         playerController.entity.abilityManager.RemoveAbility(playerController.entity.abilityIndexDict[talent.TalentAbility.ID]);
     }
 }
Beispiel #52
0
		/// <summary>
		/// 更新一条数据
		/// </summary>
		public bool Update(Talent.Model.TB_RC_TalentInfor model)
		{
			StringBuilder strSql=new StringBuilder();
			strSql.Append("update TB_RC_TalentInfor set ");
			strSql.Append("TI_CB_No=@TI_CB_No,");
            strSql.Append("TI_OtherCBName=@TI_OtherCBName,");
			strSql.Append("TI_BrandName=@TI_BrandName,");
			strSql.Append("TI_TalentClass=@TI_TalentClass,");
			strSql.Append("TI_Name=@TI_Name,");
			strSql.Append("TI_Sex=@TI_Sex,");
			strSql.Append("TI_Phone=@TI_Phone,");
			strSql.Append("TI_Src=@TI_Src,");
			strSql.Append("TI_RecommendPost=@TI_RecommendPost,");
			strSql.Append("TI_Audition=@TI_Audition,");
			strSql.Append("TI_AuditionResult=@TI_AuditionResult,");
			strSql.Append("TI_FollowUpPeople=@TI_FollowUpPeople,");
			strSql.Append("TI_MaintainDate=@TI_MaintainDate,");
			strSql.Append("TI_MaintainResult=@TI_MaintainResult,");
			strSql.Append("TI_CreatePer=@TI_CreatePer,");
			strSql.Append("TI_CreateDate=@TI_CreateDate,");
            strSql.Append("TI_Mark=@TI_Mark,");
            strSql.Append("TI_Work=@TI_Work,");
            strSql.Append("TI_Industry=@TI_Industry,");
            strSql.Append("TI_Recommend=@TI_Recommend,");
            strSql.Append("TI_RecommendDate=@TI_RecommendDate,");
            strSql.Append("TI_Email=@TI_Email,");
            strSql.Append("TI_Reason=@TI_Reason,");
            strSql.Append("TI_Interviewer=@TI_Interviewer,");
            strSql.Append("TI_OtherRecommendPost=@TI_OtherRecommendPost");
			strSql.Append(" where TI_No=@TI_No");
			SqlParameter[] parameters = {
					new SqlParameter("@TI_CB_No", SqlDbType.Int,4),
                    new SqlParameter("@TI_OtherCBName", SqlDbType.VarChar,150),
					new SqlParameter("@TI_BrandName", SqlDbType.VarChar,100),
					new SqlParameter("@TI_TalentClass", SqlDbType.VarChar,100),
					new SqlParameter("@TI_Name", SqlDbType.VarChar,50),
					new SqlParameter("@TI_Sex", SqlDbType.VarChar,10),
					new SqlParameter("@TI_Phone", SqlDbType.VarChar,100),
					new SqlParameter("@TI_Src", SqlDbType.VarChar,100),
					new SqlParameter("@TI_RecommendPost", SqlDbType.VarChar,100),
					new SqlParameter("@TI_Audition", SqlDbType.VarChar,10),
					new SqlParameter("@TI_AuditionResult", SqlDbType.VarChar,200),
					new SqlParameter("@TI_FollowUpPeople", SqlDbType.VarChar,200),
					new SqlParameter("@TI_MaintainDate", SqlDbType.DateTime),
					new SqlParameter("@TI_MaintainResult", SqlDbType.VarChar,200),
					new SqlParameter("@TI_CreatePer", SqlDbType.VarChar,20),
					new SqlParameter("@TI_CreateDate", SqlDbType.DateTime),
                    new SqlParameter("@TI_Mark", SqlDbType.VarChar,100),
                    new SqlParameter("@TI_Work", SqlDbType.VarChar,1000),
                    new SqlParameter("@TI_Industry", SqlDbType.VarChar,400),
                    new SqlParameter("@TI_Recommend", SqlDbType.VarChar,100),
                    new SqlParameter("@TI_RecommendDate", SqlDbType.DateTime),
                    new SqlParameter("@TI_Email", SqlDbType.VarChar,100),
                    new SqlParameter("@TI_Reason", SqlDbType.VarChar,200),
                    new SqlParameter("@TI_Interviewer", SqlDbType.VarChar,50),
                    new SqlParameter("@TI_OtherRecommendPost", SqlDbType.VarChar,100),
					new SqlParameter("@TI_No", SqlDbType.Int,4)};
			parameters[0].Value = model.TI_CB_No;
            parameters[1].Value = model.TI_OtherCBName;
			parameters[2].Value = model.TI_BrandName;
			parameters[3].Value = model.TI_TalentClass;
			parameters[4].Value = model.TI_Name;
			parameters[5].Value = model.TI_Sex;
			parameters[6].Value = model.TI_Phone;
			parameters[7].Value = model.TI_Src;
			parameters[8].Value = model.TI_RecommendPost;
			parameters[9].Value = model.TI_Audition;
			parameters[10].Value = model.TI_AuditionResult;
			parameters[11].Value = model.TI_FollowUpPeople;
			parameters[12].Value = model.TI_MaintainDate;
			parameters[13].Value = model.TI_MaintainResult;
			parameters[14].Value = model.TI_CreatePer;
			parameters[15].Value = model.TI_CreateDate;
            parameters[16].Value = model.TI_Mark;
            parameters[17].Value = model.TI_Work;
            parameters[18].Value = model.TI_Industry;
            parameters[19].Value = model.TI_Recommend;
            parameters[20].Value = model.TI_RecommendDate;
            parameters[21].Value = model.TI_Email;
            parameters[22].Value = model.TI_Reason;
            parameters[23].Value = model.TI_Interviewer;
            parameters[24].Value = model.TI_OtherRecommendPost;
            parameters[25].Value = model.TI_No;

            int rows = dbhelp.ExecuteSql(strSql.ToString(), parameters);
			if (rows > 0)
			{
				return true;
			}
			else
			{
				return false;
			}
		}
Beispiel #53
0
    public AssassinFactory()
    {
        baseModel = Resources.Load<GameObject>("AssassinModel");

        attackPower = 1.2f;
        armor = 0.1f;
        maxHP = 6*2;
        maxMP = 6;

        //baseSkills.Add(SkillFactory.GetShiv());
        baseSkills.Add(SkillFactory.GetFade());
        baseSkills.Add(SkillFactory.GetCripple());

        Talent t = new Talent();
        t.name = "Shadow Drift";
        t.description = "The assassin teleports to any tile within a huge distance.";
        t.IfChosen = unit => {
            unit.AddSkill(SkillFactory.getShadowDrift());
        };
        talentOptions.Add(t);

        t = new Talent();
        t.name = "Leach";
        t.description = "30% of damage dealt is healed.";
        t.IfChosen = unit =>
        {
            unit.AddEffect(EffectFactory.getVampiricEffect(), -1);
        };
        talentOptions.Add(t);

        t = new Talent();
        t.name = "Single Out";
        t.description = "Deal double damage to units with no allies within 3 tiles.";
        t.IfChosen = unit =>
        {
            unit.AddSkill(SkillFactory.GetShiv());
            unit.AddEffect(EffectFactory.getSingledOutEffect(), -1);
        };
        talentOptions.Add(t);

        t = new Talent();
        t.name = "Pierce";
        t.description = "Shiv is replace by pierce, a ranged attack with similar damage.";
        t.IfChosen = unit =>
        {
            unit.AddSkill(SkillFactory.getPierce());
        };
        talentOptions.Add(t);

        t = new Talent();
        t.name = "Efficiency";
        t.description = "Move which slightly heals an ally or slightly damages an enemy. Has no energy cost, and restores energy to the caster.";
        t.IfChosen = unit =>
        {
            unit.AddSkill(SkillFactory.getEfficiency());
        };
        talentOptions.Add(t);

        t = new Talent();
        t.name = "Acid Blade";
        t.description = "Assassin stabs an enemy. Weaker than shiv, but pierces and corrodes an enemy's armor.";
        t.IfChosen = unit =>
        {
            unit.AddSkill(SkillFactory.getAcidBlade());
        };
        talentOptions.Add(t);

        name = "Assassin";
        description = "A spooky dangerous assassin, who deals a lot of damage";
        image = Resources.Load<Sprite>("CharacterIcons/AssassinIcon");
    }
Beispiel #54
0
    public TankFactory()
    {
        baseModel = Resources.Load<GameObject>("TankModel");

        attackPower = 0.9f;
        armor = 0.4f;
        maxHP = 7*2;
        maxMP = 6;

        baseSkills.Add(SkillFactory.GetSlam());
        baseSkills.Add(SkillFactory.GetWeakenDefense());
        baseSkills.Add(SkillFactory.GetTaunt());

        Talent t = new Talent();
        t.name = "Enrage";
        t.description = "While health is below 50%, damage goes up by 20%";
        t.IfChosen = unit => {
            unit.AddEffect(EffectFactory.getEnrageEffect(), -1);
        };
        talentOptions.Add(t);

        t = new Talent();
        t.name = "Surrounded";
        t.description = "Whenever the tank is hit, if there are more than two enemies nearby, their attacks will recoil half the damage to eachother. This damage is never fatal.";
        t.IfChosen = unit =>
        {
            unit.AddEffect(EffectFactory.getSurroundedEffect(),-1);
        };
        talentOptions.Add(t);

        t = new Talent();
        t.name = "Grand Slam";
        t.description = "Double's Slam's Damage, but halfs the root effect";
        t.IfChosen = unit =>
        {
            unit.talentTags.Add("HardSlam");
        };
        talentOptions.Add(t);

        t = new Talent();
        t.name = "Determination";
        t.description = "If the tank's health would go below 30% from an attack, the tank is first fully healed. Has a 6 turn cooldown";
        t.IfChosen = unit =>
        {
            unit.AddEffect(EffectFactory.getDeterminationEffect(),-1); //-1 is permanent
        };
        talentOptions.Add(t);

        t = new Talent();
        t.name = "Front Lines";
        t.description = "For each enemy within 3 tiles, gain 3% hp per turn";
        t.IfChosen = unit =>
        {
            unit.AddEffect(EffectFactory.getFrontLineEffect(),-1);
        };
        talentOptions.Add(t);

        t = new Talent();
        t.name = "Toughness";
        t.description = "The Tank is just tough. Nothing complicated. Slight increase to armor and damage.";
        t.IfChosen = Unit =>
        {
            Unit.AddEffect(EffectFactory.getToughEffect(), -1);
        };
        talentOptions.Add(t);

        name = "Tank";
        description = "A tank. Deals and takes little damage. Hinders enemies to protect his team.";
        image = Resources.Load<Sprite>("CharacterIcons/TankIcon");
    }
Beispiel #55
0
    public TechFactory()
    {
        baseModel = Resources.Load<GameObject>("TechModel");

        attackPower = 0.9f;
        armor = 0.4f;
        maxHP = 10;
        maxMP = 6;

        baseSkills.Add(SkillFactory.GetSnipe());
        baseSkills.Add(SkillFactory.GetRepair());
        baseSkills.Add(SkillFactory.GetMakeSentry());

        Talent t = new Talent();
        t.name = "Med Station";
        t.description = "Able to create med stations. Static structures that restore health to nearby allies every turn.";
        t.IfChosen = unit => {
            unit.AddSkill(SkillFactory.getMakeMedStation());
        };
        talentOptions.Add(t);

        t = new Talent();
        t.name = "Add Repair";
        t.description = "Adds Repair to Class";
        t.IfChosen = unit =>
        {
            unit.AddSkill(SkillFactory.GetRepair());
        };
        talentOptions.Add(t);

        t = new Talent();
        t.name = "Battle Bot";
        t.description = "Creates a mobile robot buddy. Will move to and attack enemies for you.";
        t.IfChosen = unit =>
        {
            unit.AddSkill(SkillFactory.getMakeBattlePet());
        };
        talentOptions.Add(t);

        t = new Talent();
        t.name = "Sticky Grenade";
        t.description = "Attaches a sticky grenade to an enemy, which explodes after 2 turns.";
        t.IfChosen = unit =>
        {
            unit.AddSkill(SkillFactory.getStickyGrenade());
        };
        talentOptions.Add(t);

        t = new Talent();
        t.name = "Master Sniper";
        t.description = "Snipe is free.";
        t.IfChosen = unit =>
        {
            unit.talentTags.Add("FreeSnipe");
        };
        talentOptions.Add(t);

        t = new Talent();
        t.name = "Toughness";
        t.description = "The Tech is just tough. Nothing complicated. Slight increase to armor and damage.";
        t.IfChosen = Unit =>
        {
            Unit.AddEffect(EffectFactory.getToughEffect(), -1);
        };
        talentOptions.Add(t);

        name = "Technician";
        description = "A repairman who can build robots";
        image = Resources.Load<Sprite>("CharacterIcons/TechIcon");
    }
Beispiel #56
0
 public void RemovePassive(Talent talent)
 {
     bonuses[talent.Bonus] = false;
     bonusRanks[talent.Bonus] = 0;
 }
Beispiel #57
0
 public void AddPassive(Talent talent)
 {
     bonuses[talent.Bonus] = true;
     bonusRanks[talent.Bonus] = talent.CurrentPoints;
 }
Beispiel #58
0
		/// <summary>
		/// 更新一条数据
		/// </summary>
		public bool Update(Talent.Model.TB_RC_CompanyBasic model)
		{
			StringBuilder strSql=new StringBuilder();
			strSql.Append("update TB_RC_CompanyBasic set ");
			strSql.Append("CB_Des=@CB_Des,");
			strSql.Append("CB_Name=@CB_Name,");
			strSql.Append("CB_Position=@CB_Position,");
			strSql.Append("CB_Num=@CB_Num,");
			strSql.Append("CB_SetUp=@CB_SetUp,");
			strSql.Append("CB_Je=@CB_Je,");
			strSql.Append("CB_Scale=@CB_Scale,");
			strSql.Append("CB_BrandName=@CB_BrandName,");
			strSql.Append("CB_PriceSection=@CB_PriceSection,");
			strSql.Append("CB_Category=@CB_Category,");
			strSql.Append("CB_ModeOperation=@CB_ModeOperation,");
			strSql.Append("CB_ShopNum=@CB_ShopNum,");
			strSql.Append("CB_Founder=@CB_Founder,");
			strSql.Append("CB_Advantage=@CB_Advantage,");
			strSql.Append("CB_OrgStructure=@CB_OrgStructure,");
			strSql.Append("CB_KeyPerson=@CB_KeyPerson,");
			strSql.Append("CB_HumanSrc=@CB_HumanSrc,");
			strSql.Append("CB_CreatePer=@CB_CreatePer,");
			strSql.Append("CB_CreateDate=@CB_CreateDate,");
            strSql.Append("CB_Province=@CB_Province,");
            strSql.Append("CB_X=@CB_X,");
            strSql.Append("CB_Y=@CB_Y,");
            strSql.Append("CB_Img=@CB_Img,");
            strSql.Append("CB_Css=@CB_Css,");
            strSql.Append("CB_BrandStyle=@CB_BrandStyle");
			strSql.Append(" where CB_No=@CB_No");
			SqlParameter[] parameters = {
					new SqlParameter("@CB_Des", SqlDbType.Text),
					new SqlParameter("@CB_Name", SqlDbType.VarChar,100),
					new SqlParameter("@CB_Position", SqlDbType.VarChar,400),
					new SqlParameter("@CB_Num", SqlDbType.Int,4),
					new SqlParameter("@CB_SetUp", SqlDbType.DateTime),
					new SqlParameter("@CB_Je", SqlDbType.VarChar,50),
					new SqlParameter("@CB_Scale", SqlDbType.VarChar,400),
					new SqlParameter("@CB_BrandName", SqlDbType.VarChar,100),
					new SqlParameter("@CB_PriceSection", SqlDbType.VarChar,200),
					new SqlParameter("@CB_Category", SqlDbType.VarChar,200),
					new SqlParameter("@CB_ModeOperation", SqlDbType.VarChar,400),
					new SqlParameter("@CB_ShopNum", SqlDbType.Int,4),
					new SqlParameter("@CB_Founder", SqlDbType.Text),
					new SqlParameter("@CB_Advantage", SqlDbType.Text),
					new SqlParameter("@CB_OrgStructure", SqlDbType.Text),
					new SqlParameter("@CB_KeyPerson", SqlDbType.Text),
					new SqlParameter("@CB_HumanSrc", SqlDbType.Text),
					new SqlParameter("@CB_CreatePer", SqlDbType.VarChar,20),
					new SqlParameter("@CB_CreateDate", SqlDbType.DateTime),
                    new SqlParameter("@CB_Province", SqlDbType.VarChar,50),
                    new SqlParameter("@CB_X", SqlDbType.VarChar,50),
                    new SqlParameter("@CB_Y", SqlDbType.VarChar,50),
                    new SqlParameter("@CB_Img", SqlDbType.VarChar,200),
                    new SqlParameter("@CB_Css", SqlDbType.VarChar,1000),
                    new SqlParameter("@CB_BrandStyle", SqlDbType.VarChar,200),
					new SqlParameter("@CB_No", SqlDbType.Int,4)};
			parameters[0].Value = model.CB_Des;
			parameters[1].Value = model.CB_Name;
			parameters[2].Value = model.CB_Position;
			parameters[3].Value = model.CB_Num;
			parameters[4].Value = model.CB_SetUp;
			parameters[5].Value = model.CB_Je;
			parameters[6].Value = model.CB_Scale;
			parameters[7].Value = model.CB_BrandName;
			parameters[8].Value = model.CB_PriceSection;
			parameters[9].Value = model.CB_Category;
			parameters[10].Value = model.CB_ModeOperation;
			parameters[11].Value = model.CB_ShopNum;
			parameters[12].Value = model.CB_Founder;
			parameters[13].Value = model.CB_Advantage;
			parameters[14].Value = model.CB_OrgStructure;
			parameters[15].Value = model.CB_KeyPerson;
			parameters[16].Value = model.CB_HumanSrc;
			parameters[17].Value = model.CB_CreatePer;
			parameters[18].Value = model.CB_CreateDate;
            parameters[19].Value = model.CB_Province;
            parameters[20].Value = model.CB_X;
            parameters[21].Value = model.CB_Y;
            parameters[22].Value = model.CB_Img;
            parameters[23].Value = model.CB_Css;
            parameters[24].Value = model.CB_BrandStyle;
            parameters[25].Value = model.CB_No;

            int rows = dbhelp.ExecuteSql(strSql.ToString(), parameters);
			if (rows > 0)
			{
				return true;
			}
			else
			{
				return false;
			}
		}
Beispiel #59
0
		/// <summary>
		/// 增加一条数据
		/// </summary>
		public int Add(Talent.Model.TB_RC_CompanyBasic model)
		{
			StringBuilder strSql=new StringBuilder();
			strSql.Append("insert into TB_RC_CompanyBasic(");
            strSql.Append("CB_Des,CB_Name,CB_Position,CB_Num,CB_SetUp,CB_Je,CB_Scale,CB_BrandName,CB_PriceSection,CB_Category,CB_ModeOperation,CB_ShopNum,CB_Founder,CB_Advantage,CB_OrgStructure,CB_KeyPerson,CB_HumanSrc,CB_CreatePer,CB_CreateDate,CB_Province,CB_X,CB_Y,CB_Img,CB_Css,CB_BrandStyle)");
			strSql.Append(" values (");
            strSql.Append("@CB_Des,@CB_Name,@CB_Position,@CB_Num,@CB_SetUp,@CB_Je,@CB_Scale,@CB_BrandName,@CB_PriceSection,@CB_Category,@CB_ModeOperation,@CB_ShopNum,@CB_Founder,@CB_Advantage,@CB_OrgStructure,@CB_KeyPerson,@CB_HumanSrc,@CB_CreatePer,@CB_CreateDate,@CB_Province,@CB_X,@CB_Y,@CB_Img,@CB_Css,@CB_BrandStyle)");
			strSql.Append(";select @@IDENTITY");
			SqlParameter[] parameters = {
					new SqlParameter("@CB_Des", SqlDbType.Text),
					new SqlParameter("@CB_Name", SqlDbType.VarChar,100),
					new SqlParameter("@CB_Position", SqlDbType.VarChar,400),
					new SqlParameter("@CB_Num", SqlDbType.Int,4),
					new SqlParameter("@CB_SetUp", SqlDbType.DateTime),
					new SqlParameter("@CB_Je", SqlDbType.VarChar,50),
					new SqlParameter("@CB_Scale", SqlDbType.VarChar,400),
					new SqlParameter("@CB_BrandName", SqlDbType.VarChar,100),
					new SqlParameter("@CB_PriceSection", SqlDbType.VarChar,200),
					new SqlParameter("@CB_Category", SqlDbType.VarChar,200),
					new SqlParameter("@CB_ModeOperation", SqlDbType.VarChar,400),
					new SqlParameter("@CB_ShopNum", SqlDbType.Int,4),
					new SqlParameter("@CB_Founder", SqlDbType.Text),
					new SqlParameter("@CB_Advantage", SqlDbType.Text),
					new SqlParameter("@CB_OrgStructure", SqlDbType.Text),
					new SqlParameter("@CB_KeyPerson", SqlDbType.Text),
					new SqlParameter("@CB_HumanSrc", SqlDbType.Text),
					new SqlParameter("@CB_CreatePer", SqlDbType.VarChar,20),
					new SqlParameter("@CB_CreateDate", SqlDbType.DateTime),
                    new SqlParameter("@CB_Province", SqlDbType.VarChar,50),
                    new SqlParameter("@CB_X", SqlDbType.VarChar,50),
                    new SqlParameter("@CB_Y", SqlDbType.VarChar,50),
                    new SqlParameter("@CB_Img", SqlDbType.VarChar,200),
                    new SqlParameter("@CB_Css", SqlDbType.VarChar,1000),
                    new SqlParameter("@CB_BrandStyle", SqlDbType.VarChar,200)};
			parameters[0].Value = model.CB_Des;
			parameters[1].Value = model.CB_Name;
			parameters[2].Value = model.CB_Position;
			parameters[3].Value = model.CB_Num;
			parameters[4].Value = model.CB_SetUp;
			parameters[5].Value = model.CB_Je;
			parameters[6].Value = model.CB_Scale;
			parameters[7].Value = model.CB_BrandName;
			parameters[8].Value = model.CB_PriceSection;
			parameters[9].Value = model.CB_Category;
			parameters[10].Value = model.CB_ModeOperation;
			parameters[11].Value = model.CB_ShopNum;
			parameters[12].Value = model.CB_Founder;
			parameters[13].Value = model.CB_Advantage;
			parameters[14].Value = model.CB_OrgStructure;
			parameters[15].Value = model.CB_KeyPerson;
			parameters[16].Value = model.CB_HumanSrc;
			parameters[17].Value = model.CB_CreatePer;
			parameters[18].Value = model.CB_CreateDate;
            parameters[19].Value = model.CB_Province;
            parameters[20].Value = model.CB_X;
            parameters[21].Value = model.CB_Y;
            parameters[22].Value = model.CB_Img;
            parameters[23].Value = model.CB_Css;
            parameters[24].Value = model.CB_BrandStyle;

            object obj = dbhelp.GetSingle(strSql.ToString(), parameters);
			if (obj == null)
			{
				return 0;
			}
			else
			{
				return Convert.ToInt32(obj);
			}
		}
Beispiel #60
0
    /// <summary>
    /// Checks to see if a talent is active.
    /// A talent is active if there are enough points in the talent's tree to make its use valid based on the talent's depth.
    /// </summary>
    /// <param name="talent">The talent to determine active/inactive.</param>
    /// <returns></returns>
    public bool IsTalentActive(Talent talent)
    {
        if (mightTree.Contains(talent) == true)
        {

            if (mightTreePoints >= talent.Depth * depthMultiplier)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
        else if (magicTree.Contains(talent) == true)
        {
            if (magicTreePoints >= talent.Depth * depthMultiplier)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
        else
        {
            return false;
        }
    }