コード例 #1
0
        public void SetPrerequisites(IEnumerable <Feat> feats)
        {
            string[] delimiters     = new string[] { "," };
            var      splitPrereqs   = PrerequisitesString.Split(delimiters, StringSplitOptions.RemoveEmptyEntries);
            var      trimmedPrereqs = new List <string>();

            foreach (var str in splitPrereqs)
            {
                trimmedPrereqs.Add(str.Trim());
            }

            var List = feats.ToList();

            foreach (var prereq in trimmedPrereqs)
            {
                //if (List.Exists(f => f.Name == prereq))
                //{
                //    Prerequisites.Add(List.Where(f => f.Name == prereq).FirstOrDefault());
                //    continue;
                //}
                Prerequisites.Add(prereq);
            }

            if (int.TryParse(Regex.Match(PrerequisitesString, @"(?<=base attack bonus )(\+\d*)").Value, out int number))
            {
                BabRequirement = number;
            }
        }
コード例 #2
0
 //**************************************
 //练习2修改,增加if判断语句,只有c的课程与当前课程课程号不同才会执行增加先修课程
 public void AddPrerequisite(Course c)
 {
     if (c.CourseNumber != this.CourseNumber)
     {
         Prerequisites.Add(c);
     }
 }
コード例 #3
0
 //**************************************
 //
 public void AddPrerequisite(Course c)
 {
     //确保一门课程不能把增加设为先修课程
     if (c.CourseNumber != this.CourseNumber)
     {
         Prerequisites.Add(c);
     }
 }
コード例 #4
0
    //练习2  
    public void AddPrerequisite(Course c)
    {
        if (this == c)
        {
            Console.WriteLine("不能将自己设为先修课");

        }
        else
        {
            Prerequisites.Add(c);
        }

    }
コード例 #5
0
        private async Task LoadPrereqsAsync()
        {
            Prerequisites.Clear();
            var prereqs = await Task.Run(() => _Repository.Prerequisite.GetRange(c => c.CourseId == Model.CourseId));
            foreach (var prerequisite in prereqs)
            {
                //for displaying in list. Gets qualification
                var prereq = await Task.Run(() => _Repository.Qualification.Get(c => c.QualificationId == prerequisite.QualificationId));
                prerequisite.Qualification = prereq;
                //end

                Prerequisites.Add(new PrereqModel(prerequisite, _Repository));
            }
        }
コード例 #6
0
        /// <inheritdoc />
        public override IWireSerialiser Read(WireReader reader)
        {
            Id = reader.ReadUInt16();
            var flags = reader.ReadUInt16();

            QR     = (flags & 0x8000) == 0x8000;
            Opcode = (MessageOperation)((flags & 0x7800) >> 11);
            Z      = (flags & 0x07F0) >> 4;
            Status = (MessageStatus)(flags & 0x000F);
            var zocount = reader.ReadUInt16();
            var prcount = reader.ReadUInt16();
            var upcount = reader.ReadUInt16();
            var arcount = reader.ReadUInt16();

            for (var i = 0; i < zocount; ++i)
            {
                Zone = (Question) new Question().Read(reader);
            }
            for (var i = 0; i < prcount; ++i)
            {
                var rr = (ResourceRecord) new ResourceRecord().Read(reader);
                Prerequisites.Add(rr);
            }
            for (var i = 0; i < upcount; ++i)
            {
                var rr = (ResourceRecord) new ResourceRecord().Read(reader);
                Updates.Add(rr);
            }
            for (var i = 0; i < arcount; ++i)
            {
                var rr = (ResourceRecord) new ResourceRecord().Read(reader);
                AdditionalResources.Add(rr);
            }

            return(this);
        }
コード例 #7
0
ファイル: Quest.cs プロジェクト: zunath/SWLOR_NWN
 public IQuest AddPrerequisite(IQuestPrerequisite prerequisite)
 {
     Prerequisites.Add(prerequisite);
     return(this);
 }
コード例 #8
0
 //**************************************
 //
 public void AddPrerequisite(Course c)
 {
     Prerequisites.Add(c);
 }
コード例 #9
0
ファイル: Quest.cs プロジェクト: taelon875/NWN.FinalFantasy
 /// <summary>
 /// Adds a new prerequisite for accepting this quest.
 /// </summary>
 /// <param name="prerequisite">The new prerequisite to add.</param>
 protected void AddPrerequisite(IQuestPrerequisite prerequisite)
 {
     Prerequisites.Add(prerequisite);
 }