Пример #1
0
        private void SetReaderToObject(ref TalentPrereqORCondition objTalentPrereqORCondition, ref SqlDataReader result)
        {
            if (result.HasRows)
            {
                objTalentPrereqORCondition.TalentPrereqORConditionID = (int)result.GetValue(result.GetOrdinal("TalentPrereqORConditionID"));
                objTalentPrereqORCondition.TalentID            = (int)result.GetValue(result.GetOrdinal("TalentID"));
                objTalentPrereqORCondition.TalentRequirementID = (int)result.GetValue(result.GetOrdinal("TalentRequirementID"));
                objTalentPrereqORCondition.FeatID                   = (int)result.GetValue(result.GetOrdinal("FeatID"));
                objTalentPrereqORCondition.RaceID                   = (int)result.GetValue(result.GetOrdinal("RaceID"));
                objTalentPrereqORCondition.TalentTreeID             = (int)result.GetValue(result.GetOrdinal("TalentTreeID"));
                objTalentPrereqORCondition.TalentTreeTalentQuantity = (int)result.GetValue(result.GetOrdinal("TalentTreeTalentQuantity"));
                objTalentPrereqORCondition.AbilityID                = (int)result.GetValue(result.GetOrdinal("AbilityID"));
                objTalentPrereqORCondition.AbilityMinimum           = (int)result.GetValue(result.GetOrdinal("AbilityMinimum"));
                objTalentPrereqORCondition.SkillID                  = (int)result.GetValue(result.GetOrdinal("SkillID"));

                if (objTalentPrereqORCondition.TalentID != 0)
                {
                    Talent objTalent = new Talent();
                    objTalentPrereqORCondition.objTalent = objTalent.GetTalent(objTalentPrereqORCondition.TalentID);
                }

                if (objTalentPrereqORCondition.TalentRequirementID != 0)
                {
                    Talent objTalentRequirement = new Talent();
                    objTalentPrereqORCondition.objTalentRequirement = objTalent.GetTalent(objTalentPrereqORCondition.TalentID);
                }

                if (objTalentPrereqORCondition.FeatID != 0)
                {
                    Feat objFeat = new Feat();
                    objTalentPrereqORCondition.objFeat = objFeat.GetFeat(objTalentPrereqORCondition.FeatID);
                }

                if (objTalentPrereqORCondition.RaceID != 0)
                {
                    Race objRace = new Race();
                    objTalentPrereqORCondition.objRace = objRace.GetRace(objTalentPrereqORCondition.FeatID);
                }

                if (objTalentPrereqORCondition.TalentTreeID != 0)
                {
                    TalentTree objTalentTree = new TalentTree();
                    objTalentPrereqORCondition.objTalentTree = objTalentTree.GetTalentTree(objTalentPrereqORCondition.TalentTreeID);
                }

                if (objTalentPrereqORCondition.AbilityID != 0)
                {
                    TalentPrerequisteAbility objTalentPrerequisteAbility = new TalentPrerequisteAbility();
                    objTalentPrereqORCondition.objTalentPrerequisteAbility = objTalentPrerequisteAbility.GetTalentPrerequisteAbility(this.TalentID, this.AbilityID);
                }

                if (objTalentPrereqORCondition.SkillID != 0)
                {
                    Skill objSkill = new Skill();
                    objTalentPrereqORCondition.objSkill = objSkill.GetSkill(objTalentPrereqORCondition.SkillID);
                }
            }
        }
        /// <summary>
        /// Clones the specified LST TalentPrerequisteAbility.
        /// </summary>
        /// <param name="lstTalentPrerequisteAbility">The LST TalentPrerequisteAbility.</param>
        /// <returns>List<TalentPrerequisteAbility></returns>
        static public List <TalentPrerequisteAbility> Clone(List <TalentPrerequisteAbility> lstTalentPrerequisteAbility)
        {
            List <TalentPrerequisteAbility> lstCTalentPrerequisteAbility = new List <TalentPrerequisteAbility>();

            foreach (TalentPrerequisteAbility objTalentPrerequisteAbility in lstTalentPrerequisteAbility)
            {
                lstCTalentPrerequisteAbility.Add(TalentPrerequisteAbility.Clone(objTalentPrerequisteAbility));
            }

            return(lstCTalentPrerequisteAbility);
        }
        /// <summary>
        /// Sets the reader to object.
        /// </summary>
        /// <param name="objTalentPrerequisteAbility">The object talent prerequiste ability.</param>
        /// <param name="result">The result.</param>
        private void SetReaderToObject(ref TalentPrerequisteAbility objTalentPrerequisteAbility, ref SqlDataReader result)
        {
            if (result.HasRows)
            {
                objTalentPrerequisteAbility.AbilityID      = (int)result.GetValue(result.GetOrdinal("AbilityID"));
                objTalentPrerequisteAbility.TalentID       = (int)result.GetValue(result.GetOrdinal("TalentID"));
                objTalentPrerequisteAbility.AbilityMinimum = (int)result.GetValue(result.GetOrdinal("AbilityMinimum"));

                //Talent objTal = new Talent();
                //objTalentPrerequisteAbility.objTalent = objTal.GetTalent(objTalentPrerequisteAbility.TalentID);

                Ability objAbil = new Ability();
                objTalentPrerequisteAbility.objAbility = objAbil.GetAbility(objTalentPrerequisteAbility.AbilityID);
            }
        }
Пример #4
0
        /// <summary>
        /// Sets the reader to object.
        /// </summary>
        /// <param name="result">The result.</param>
        private void SetReaderToObject(ref SqlDataReader result)
        {
            if (result.HasRows)
            {
                this.TalentID          = (int)result.GetValue(result.GetOrdinal("TalentID"));
                this.TalentName        = result.GetValue(result.GetOrdinal("TalentName")).ToString();
                this.TalentDescription = result.GetValue(result.GetOrdinal("TalentDescription")).ToString();
                this.TalentTreeID      = (int)result.GetValue(result.GetOrdinal("TalentTreeID"));
                this.MultipleSelection = (int)result.GetValue(result.GetOrdinal("MultipleSelection"));
                this.BookID            = (int)result.GetValue(result.GetOrdinal("BookID"));
                this.TalentSpecial     = result.GetValue(result.GetOrdinal("TalentSpecial")).ToString();

                this._objComboBoxData.Add(this.TalentID, this.TalentName);

                TurnSegment objTurnSegment = new TurnSegment();
                if (!(this.TurnSegmentID == 0))
                {
                    objTurnSegment.GetTurnSegment(this.TurnSegmentID);
                }
                this.objTurnSegment = objTurnSegment;


                Talent objPreTalent = new Talent();
                this.objPrerequsiteTalent = objPreTalent.GetPrerequisteTalents(" otmTalentPrerequisteTalent.TalentID=" + this.TalentID.ToString(), "TalentName");

                //List<Ability> objPrerequisteAbility
                TalentPrerequisteAbility objTalentPrerequisteAbility = new TalentPrerequisteAbility();
                this.objTalentPrerequisteAbility = objTalentPrerequisteAbility.GetTalentPrerequisteAbilities("TalentID=" + this.TalentID.ToString(), "");

                Skill objSkill = new Skill();
                this.objTalentPrerequsiteSkill = objSkill.GetTalentRequiredSkills("TalentID=" + this.TalentID.ToString(), "");

                Feat objFeat = new Feat();
                this.objTalentPrerequsiteFeat = objFeat.GetTalentPrerequisiteFeats("TalentID=" + this.TalentID.ToString(), "");

                ForcePower objPreForcePower = new ForcePower();
                this.objTalentPrerequisteForcePower = objPreForcePower.GetTalentPrequisteForcePowers("TalentID=" + this.TalentID.ToString(), "");

                BaseAttack objBaseAttack = new BaseAttack();
                this.objBaseAttackPrerequisite = objBaseAttack.GetFeatPrequisiteBaseAttackBonus(this.TalentID);
            }
        }
        /// <summary>
        /// Gets the talent prerequiste ability list.
        /// </summary>
        /// <param name="strSprocName">Name of the string sproc.</param>
        /// <param name="strWhere">The string where.</param>
        /// <param name="strOrderBy">The string order by.</param>
        /// <returns>List of TalentPrerequisteAbility objects</returns>
        private List <TalentPrerequisteAbility> GetTalentPrerequisteAbilityList(string strSprocName, string strWhere, string strOrderBy)
        {
            List <TalentPrerequisteAbility> talentPrerequisteAbilities = new List <TalentPrerequisteAbility>();

            SqlDataReader      result;
            DatabaseConnection dbconn     = new DatabaseConnection();
            SqlCommand         command    = new SqlCommand();
            SqlConnection      connection = new SqlConnection(dbconn.SQLSEVERConnString);

            try
            {
                connection.Open();
                command.Connection  = connection;
                command.CommandType = CommandType.StoredProcedure;
                command.CommandText = strSprocName;
                command.Parameters.Add(dbconn.GenerateParameterObj("@strWhere", SqlDbType.VarChar, strWhere, 1000));
                command.Parameters.Add(dbconn.GenerateParameterObj("@strOrderBy", SqlDbType.VarChar, strOrderBy, 1000));
                result = command.ExecuteReader();

                while (result.Read())
                {
                    TalentPrerequisteAbility objTalentPrerequisteAbility = new TalentPrerequisteAbility();
                    SetReaderToObject(ref objTalentPrerequisteAbility, ref result);
                    talentPrerequisteAbilities.Add(objTalentPrerequisteAbility);
                }
            }
            catch
            {
                Exception e = new Exception();
                throw e;
            }
            finally
            {
                command.Dispose();
                connection.Close();
            }
            return(talentPrerequisteAbilities);
        }
        /// <summary>
        /// Clones the specified object TalentPrerequisteAbility.
        /// </summary>
        /// <param name="objTalentPrerequisteAbility">The object TalentPrerequisteAbility.</param>
        /// <returns>TalentPrerequisteAbility</returns>
        static public TalentPrerequisteAbility Clone(TalentPrerequisteAbility objTalentPrerequisteAbility)
        {
            TalentPrerequisteAbility objCTalentPrerequisteAbility = new TalentPrerequisteAbility(objTalentPrerequisteAbility.TalentID, objTalentPrerequisteAbility.AbilityID);

            return(objCTalentPrerequisteAbility);
        }