public LanguageCourseForChildren(string courseName, ECourseActivityStatus activityStatus, EGroupType groupType, ECoursePlace coursePlace,
     decimal price, IList<IPerson> studentsInCourse, IList<IPerson> teachersInCourse, IList<IClassInfo> conductedClasses, EAge age, ELanguage language, 
     ELanguageLevelForChildren languageLevelForChildren)
     : base(courseName, activityStatus, groupType, coursePlace, price, studentsInCourse, teachersInCourse, conductedClasses, age)
 {
     this.Language = language;
     this.LanguageLevel = languageLevelForChildren;
 }
 /// <summary>
 /// 从资源文件中读取group的texture并创建成Sprite
 /// </summary>
 /// <param name="type"></param>
 /// <returns></returns>
 public static Sprite CreateGroupSprite(EGroupType type)
 {
     Texture2D groupTexture;
     if (type == EGroupType.BlueSide)
         groupTexture = Resources.Load<Texture2D>("Images/GroupBlue");
     else
         groupTexture = Resources.Load<Texture2D>("Images/GroupRed");
     Sprite groupSprite = Sprite.Create(groupTexture,
         new Rect(0, 0, groupTexture.width, groupTexture.height),
         new Vector2(0.5F, 0.5F));
     return groupSprite;
 }
        private void PopulateProperties(Entity p)
        {
            Id       = p.Id;
            Name     = p.GetAttributeValue <string>("eims_name");
            Included = p.GetAttributeValue <bool>("eims_included");

            OptionSetValue groupType = p.GetAttributeValue <OptionSetValue>("eims_grouptype");

            if (groupType != null)
            {
                GroupType = (EGroupType)groupType.Value;
            }
        }
Example #4
0
 protected Course(string courseName, ECourseActivityStatus activityStatus, EGroupType groupType, ECoursePlace coursePlace,
                  decimal price, IList <IPerson> studentsInCourse, IList <IPerson> teachersInCourse, IList <IClassInfo> conductedClasses)
 {
     this.Id               = ++Course.increaseId;
     this.CourseName       = courseName;
     this.activityStatus   = activityStatus;
     this.GroupType        = groupType;
     this.coursePlace      = coursePlace;
     this.Price            = price;
     this.StudentsInCourse = studentsInCourse;
     this.TeachersInCourse = teachersInCourse;
     this.ConductedClasses = conductedClasses;
 }
Example #5
0
 protected Course(string courseName, ECourseActivityStatus activityStatus, EGroupType groupType, ECoursePlace coursePlace,
     decimal price, IList<IPerson> studentsInCourse, IList<IPerson> teachersInCourse, IList<IClassInfo> conductedClasses)
 {
     this.Id = ++Course.increaseId;
     this.CourseName = courseName;
     this.activityStatus = activityStatus;
     this.GroupType = groupType;
     this.coursePlace = coursePlace;
     this.Price = price;
     this.StudentsInCourse = studentsInCourse;
     this.TeachersInCourse = teachersInCourse;
     this.ConductedClasses = conductedClasses;
 }
        public static EGroupType GroupTypeCreator(string type)
        {
            string[]   str    = type.Split('_');
            EGroupType output = EGroupType.Individual;

            if (str[0] == "individual")
            {
                output = EGroupType.Individual;
            }
            else
            {
                switch (str[1])
                {
                case "2":
                    output = EGroupType.Group2;
                    break;

                case "3":
                    output = EGroupType.Group3;
                    break;

                case "4":
                    output = EGroupType.Group4;
                    break;

                case "5":
                    output = EGroupType.Group5;
                    break;

                case "6":
                    output = EGroupType.Group6;
                    break;

                case "7":
                    output = EGroupType.Group7;
                    break;

                case "8":
                    output = EGroupType.Group8;
                    break;

                case "over8":
                    output = EGroupType.GroupOver8;
                    break;
                }
            }

            return(output);
        }
        public static string RenderCourseToConsole(string courseType, ulong id, string courseName, ECourseActivityStatus activityStatus,
                                                   EGroupType groupType, ECoursePlace coursePlace,
                                                   decimal price, IList <IPerson> studentsInCourse, IList <IPerson> teachersInCourse,
                                                   EAge age, ECoursePlace place, ELanguage language,
                                                   ELanguageLevelForAdults languageLevelForAdults)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendLine(new string('*', 30));
            sb.AppendLine(new string('*', 30));
            sb.AppendFormat("{0}", courseType).AppendLine();
            sb.AppendFormat("{0}", id).AppendLine();
            sb.AppendFormat("{0}", courseName).AppendLine();
            sb.AppendFormat("{0}", activityStatus).AppendLine();
            sb.AppendFormat("{0}", groupType).AppendLine();
            sb.AppendFormat("{0}", coursePlace).AppendLine();
            sb.AppendFormat("{0}", age).AppendLine();
            sb.AppendFormat("{0}", language).AppendLine();
            sb.AppendFormat("{0}", languageLevelForAdults).AppendLine();
            sb.AppendFormat("{0} lev(s)", price).AppendLine().AppendLine();

            sb.AppendLine(new string('-', 30));

            sb.AppendLine("Teachers leading the course: ").AppendLine();
            foreach (var teacher in teachersInCourse)
            {
                sb.AppendFormat("{0}", teacher.ToString()).AppendLine().AppendLine();
            }
            sb.AppendLine(new string('-', 30));
            sb.AppendLine().AppendLine();

            sb.AppendLine(new string('-', 30));
            sb.AppendLine("Students taking part in the course: ").AppendLine();
            foreach (var student in studentsInCourse)
            {
                sb.AppendFormat("{0}", student.ToString()).AppendLine().AppendLine();
            }
            sb.AppendLine(new string('-', 30));

            sb.AppendLine().AppendLine();
            sb.AppendLine(new string('*', 30));
            sb.AppendLine(new string('*', 30));

            return(sb.ToString());
        }
        public static string RenderCourseToConsole(string courseType, ulong id, string courseName, ECourseActivityStatus activityStatus, 
            EGroupType groupType, ECoursePlace coursePlace,
            decimal price, IList<IPerson> studentsInCourse, IList<IPerson> teachersInCourse, 
            EAge age, ECoursePlace place, ELanguage language,
            ELanguageLevelForAdults languageLevelForAdults)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendLine(new string('*', 30));
            sb.AppendLine(new string('*', 30));
            sb.AppendFormat("{0}", courseType).AppendLine();
            sb.AppendFormat("{0}", id).AppendLine();
            sb.AppendFormat("{0}", courseName).AppendLine();
            sb.AppendFormat("{0}", activityStatus).AppendLine();
            sb.AppendFormat("{0}", groupType).AppendLine();
            sb.AppendFormat("{0}", coursePlace).AppendLine();
            sb.AppendFormat("{0}", age).AppendLine();
            sb.AppendFormat("{0}", language).AppendLine();
            sb.AppendFormat("{0}", languageLevelForAdults).AppendLine();
            sb.AppendFormat("{0} lev(s)", price).AppendLine().AppendLine();

            sb.AppendLine(new string('-', 30));

            sb.AppendLine("Teachers leading the course: ").AppendLine();
            foreach (var teacher in teachersInCourse)
            {
                sb.AppendFormat("{0}", teacher.ToString()).AppendLine().AppendLine();
            }
            sb.AppendLine(new string('-', 30));
            sb.AppendLine().AppendLine();

            sb.AppendLine(new string('-', 30));
            sb.AppendLine("Students taking part in the course: ").AppendLine();
            foreach (var student in studentsInCourse)
            {
                sb.AppendFormat("{0}", student.ToString()).AppendLine().AppendLine();
            }
            sb.AppendLine(new string('-', 30));

            sb.AppendLine().AppendLine();
            sb.AppendLine(new string('*', 30));
            sb.AppendLine(new string('*', 30));

            return sb.ToString();
        }
 // Use this for initialization
 void Start()
 {
     GroupType = EGroupType.BlueSide;                //将我方阵营设为蓝色
                                                     // test
     CurrentState = PlayerState.WaitingOperate;
     //
        //Chessboard.ClearBackground();
 }
 protected AdultCourse(string courseName, ECourseActivityStatus activityStatus, EGroupType groupType, ECoursePlace coursePlace,
                       decimal price, IList <IPerson> studentsInCourse, IList <IPerson> teachersInCourse, IList <IClassInfo> conductedClasses, EAge age)
     : base(courseName, activityStatus, groupType, coursePlace, price, studentsInCourse, teachersInCourse, conductedClasses)
 {
     this.Age = age;
 }
Example #11
0
        public void ExecuteCreate(string[] commandWords)
        {
            string[] cW = commandWords;
            switch (cW[1])
            {
            case "course_participant":
                Person courseParticipant = new CourseParticipant(cW[2], cW[3], cW[4],
                                                                 cW[5], this.ConvertStrintIntoDateTime(cW[6]), cW[7], cW[8], cW[9], cW[10],
                                                                 this.ConvertStrintIntoDateTime(cW[11]), ESallaryType.Monthly,
                                                                 decimal.Parse(cW[13]));
                this.ExecuteAdd(courseParticipant);
                break;

            case "teacher":
                Person teacher = new Teacher(cW[2], cW[3], cW[4],
                                             cW[5], this.ConvertStrintIntoDateTime(cW[6]), cW[7], cW[8], cW[9], cW[10],
                                             this.ConvertStrintIntoDateTime(cW[11]), ESallaryType.Monthly,
                                             decimal.Parse(cW[13]));
                this.ExecuteAdd(teacher);
                break;

            case "secretary":
                Person secretary = new Secretary(cW[2], cW[3], cW[4],
                                                 cW[5], this.ConvertStrintIntoDateTime(cW[6]), cW[7], cW[8], cW[9], cW[10],
                                                 this.ConvertStrintIntoDateTime(cW[11]), ESallaryType.Monthly,
                                                 decimal.Parse(cW[13]));
                this.ExecuteAdd(secretary);
                break;

            case "adult_language_course":
                string courseName                   = CourseInputer.CourseNameCreator(cW[2]);
                ECourseActivityStatus status        = CourseInputer.CourseActivityCreator(cW[3]);
                EGroupType            groupType     = CourseInputer.GroupTypeCreator(cW[4]);
                ECoursePlace          coursePlace   = cW[5] == "local" ? ECoursePlace.Local : ECoursePlace.Online;
                decimal            coursePrice      = decimal.Parse(cW[6]);
                IList <IPerson>    coursists        = CourseInputer.GetCoursistsInCourse(cW[7]);
                IList <IPerson>    teachers         = CourseInputer.GetTeachersInCourse(cW[8]);
                IList <IClassInfo> conductedClasses = new List <IClassInfo>();
                EAge      age                 = EAge.Adults;
                ELanguage language            = CourseInputer.GetLanguage(cW[11]);
                ELanguageLevelForAdults level = CourseInputer.LanguageLevelAdults("a1");
                LanguageCourseForAdults languageCourseAdults = new LanguageCourseForAdults(courseName, status, groupType,
                                                                                           coursePlace, coursePrice, coursists, teachers, conductedClasses, age, language, level);
                Course.Add(languageCourseAdults);
                break;

            case "class":
                ICourse courseToAddToClass = null;

                ulong courseId = ulong.Parse(cW[5].Split('_')[1]);
                foreach (var currentCourse in Course.CourseList)
                {
                    if (currentCourse.Id == courseId)
                    {
                        courseToAddToClass = currentCourse;
                    }
                }

                ITeacher teacherToAddToClass = null;

                ulong teacherId = ulong.Parse(cW[6].Split('_')[1]);
                foreach (var currentTeacher in Person.GetAllTeachers())
                {
                    if (currentTeacher.Id == teacherId)
                    {
                        teacherToAddToClass = (ITeacher)currentTeacher;
                    }
                }

                string[] conductionDateString = cW[2].Split('_')[1].Split('.');
                int      conductionDateYear   = int.Parse(conductionDateString[2]);
                int      conductionDateMonth  = int.Parse(conductionDateString[1]);
                int      conductionDateDay    = int.Parse(conductionDateString[0]);
                DateTime conductionDate       = new DateTime(conductionDateYear, conductionDateMonth, conductionDateDay);

                string[] startHourStringArray = cW[3].Split('_')[2].Split(':');
                int      startHourHour        = int.Parse(startHourStringArray[0]);
                int      startHourMinutes     = int.Parse(startHourStringArray[1]);
                DateTime startHour            = new DateTime(conductionDateYear, conductionDateMonth, conductionDateDay, startHourHour, startHourMinutes, 0);

                string[] endHourStringArray = cW[4].Split('_')[2].Split(':');
                int      endHourHour        = int.Parse(endHourStringArray[0]);
                int      endHourMinutes     = int.Parse(endHourStringArray[1]);
                DateTime endHour            = new DateTime(conductionDateYear, conductionDateMonth, conductionDateDay, endHourHour, endHourMinutes, 0);

                ClassInfo currentClass = new ClassInfo(conductionDate, startHour, endHour, teacherToAddToClass, courseToAddToClass);

                bool presentTeacher = false;

                foreach (var teacherInCourse in courseToAddToClass.TeachersInCourse)
                {
                    if (teacherInCourse.Id == teacherToAddToClass.Id)
                    {
                        presentTeacher = true;
                        break;
                    }
                }

                if (presentTeacher == true)
                {
                    courseToAddToClass.AddConductedClass(currentClass);
                }
                else
                {
                    throw new ArgumentException(String.Format("There's no teacher with ID {0} who conducts classes in the course with ID {1}",
                                                              teacherToAddToClass.Id, courseToAddToClass.Id));
                }
                break;

            default:
                break;
            }
        }
Example #12
0
 public LanguageCourseForChildren(string courseName, ECourseActivityStatus activityStatus, EGroupType groupType, ECoursePlace coursePlace,
                                  decimal price, IList <IPerson> studentsInCourse, IList <IPerson> teachersInCourse, IList <IClassInfo> conductedClasses, EAge age, ELanguage language,
                                  ELanguageLevelForChildren languageLevelForChildren)
     : base(courseName, activityStatus, groupType, coursePlace, price, studentsInCourse, teachersInCourse, conductedClasses, age)
 {
     this.Language      = language;
     this.LanguageLevel = languageLevelForChildren;
 }
 protected AdultCourse(string courseName, ECourseActivityStatus activityStatus, EGroupType groupType, ECoursePlace coursePlace,
     decimal price, IList<IPerson> studentsInCourse, IList<IPerson> teachersInCourse, IList<IClassInfo> conductedClasses, EAge age)
     : base(courseName, activityStatus, groupType, coursePlace, price, studentsInCourse, teachersInCourse, conductedClasses)
 {
     this.Age = age;
 }
Example #14
0
        private static Entity MockSamplingPlanParameter(string parameterName, bool included, EGroupType groupType)
        {
            Entity parameter = new Entity("eims_samplingplanparameter");

            parameter.Id                = Guid.NewGuid();
            parameter["eims_name"]      = parameterName;
            parameter["eims_included"]  = included;
            parameter["eims_grouptype"] = new OptionSetValue((int)groupType);
            return(parameter);
        }
 /// <summary>
 /// 开始新回合,重置group阵营的状态
 /// </summary>
 /// <param name="group"></param>
 public static void NewRound(EGroupType group)
 {
     foreach (var unit in UnitManager.UnitList)
     {
         if (unit.GroupType != group) continue;
         unit.Movable = true;
         unit.Attackable = true;
         if (unit.Skill_1 != null)
             unit.Skill_1.OnNewRound(group);
         if (unit.Skill_2 != null)
             unit.Skill_2.OnNewRound(group);
         if (unit.Skill_3 != null)
             unit.Skill_3.OnNewRound(group);
     }
 }
Example #16
0
        private void AddToSequence(Dictionary <EGroupType, List <CalcOperation> > calcSequences, EGroupType groupType, CalcOperation calc)
        {
            if (!calcSequences.ContainsKey(groupType))
            {
                calcSequences.Add(groupType, new List <CalcOperation>());
            }

            calcSequences[groupType].Add(calc);
        }
Example #17
0
 /// <summary>
 /// 开始新回合,重置group阵营的状态
 /// </summary>
 /// <param name="group"></param>
 public static void NewRound(EGroupType group)
 {
     throw new System.Exception();
     //foreach (var unit in UnitManager.UnitList)
     //{
     //	if (unit.GroupType != group) continue;
     //	unit.Movable = true;
     //	unit.Attackable = true;
     //	if (unit.Skill_1 != null)
     //		unit.Skill_1.OnNewRound(group);
     //	if (unit.Skill_2 != null)
     //		unit.Skill_2.OnNewRound(group);
     //	if (unit.Skill_3 != null)
     //		unit.Skill_3.OnNewRound(group);
     //}
 }
Example #18
0
 public MonthlyCount(int total, EGroupType groupType, EMonth month)
 {
     Total     = total;
     GroupType = groupType;
     Month     = month;
 }
Example #19
0
 /// <summary>
 /// 新回合时刷新技能的状态
 /// </summary>
 /// <param name="group"></param>
 public virtual void OnNewRound(EGroupType group)
 {
     if (unit.GroupType != group) return;
     usable = true;
 }
    /// <summary>
    /// 召唤单位,在任何可放置单位的位置
    /// </summary>
    /// <param name="unitID"></param>
    /// <param name="group"></param>
    /// <returns></returns>
    public static void SummonUnit(Cell cell, int unitID, EGroupType group)
    {
        if (!cell.IsCanSummonPlace()) return;       // 无法召唤的位置

        Unit newUnit = new Unit(unitID, cell.Position);
        cell.UnitOnCell = newUnit;
        cell.UnitOnCell.GroupType = group;
        cell.UnitOnCell.curCell = cell;
        // AfterSummonUnit事件
        foreach (var skill in afterUnitSummon)
            skill.SkillEffect(cell);
    }