示例#1
0
        public void Publish(Message e, string topicName)
        {
            if (e != null)
            {
                if (topicName.CompareTo(EntityType.CrewMember.ToString()) == 0)
                {
                    CrewMembers.Clear();
                    foreach (IdentifiedObject item in e.IdObjCollection)
                    {
                        CrewMembers.Add(item as CrewMember);
                    }
                    return;
                }

                if (topicName.CompareTo(EntityType.Crew.ToString()) == 0)
                {
                    Crews.Clear();
                    foreach (IdentifiedObject item in e.IdObjCollection)
                    {
                        Crews.Add(item as Crew);
                    }
                    return;
                }
            }
        }
示例#2
0
        public void AddCrewMembersToList(IEnumerable <GnApiProgramsSchema.crewTypeMember> crewList, string apiLevel, bool updateTracker = false)
        {
            var crewTypeMembers = crewList.ToList();

            if (crewTypeMembers.Any())
            {
                if (CrewMembers == null)
                {
                    CrewMembers = new List <GnApiProgramsSchema.crewTypeMember>();
                }
                if (!updateTracker)
                {
                    Log.Debug($"Number of Crew Members at {apiLevel} Level: {crewTypeMembers.Count()}");
                }

                foreach (var crew in crewTypeMembers)
                {
                    CrewMembers.Add(crew);
                }
            }
            else
            {
                if (!updateTracker)
                {
                    Log.Warn($"Crew info is currently null at the current api level: {apiLevel}, " +
                             "will continue and check next api results for Crew data");
                }
            }
        }
示例#3
0
        public Crew()
        {
            Console.WriteLine("What is the name of your crew?");
            Name = Console.ReadLine();

            var run = true;

            while (run)
            {
                var x = new TeamMember();
                if (x.Name == "")
                {
                    break;
                }
                CrewMembers.Add(x);
                if (CrewMembers.Count == 1)
                {
                    Console.WriteLine($"There is now 1 member in {Name}.");
                }
                else
                {
                    Console.WriteLine($"There are now {CrewMembers.Count} members in {Name}.");
                }
            }

            var cumulativeSkill = 0;

            CrewMembers.ForEach((member) => cumulativeSkill += member.SkillLevel);
            CumulativeSkill = cumulativeSkill;
        }
示例#4
0
 private void AddAllCommand_Execute(object parameter)
 {
     foreach (var item in AllMembers)
     {
         CrewMembers.Add(item);
     }
     AllMembers.Clear();
 }
示例#5
0
        private void AddToCrewCommand_Execute(object parameter)
        {
            foreach (var item in SelectedMembers)
            {
                CrewMembers.Add(item);
            }

            SelectedMembers.Clear();

            foreach (var item in CrewMembers)
            {
                AllMembers.Remove(item);
            }
        }