Exemple #1
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="station">The station.</param>
 /// <param name="src">The source.</param>
 internal Agent(Station station, SerializableAgent src)
 {
     Station   = station;
     ID        = src.ID;
     Name      = src.Name;
     Level     = src.Level;
     Quality   = src.Quality;
     Division  = src.DivisionName;
     AgentType = Enum.IsDefined(typeof(AgentType), src.AgentType)
                     ? (AgentType)Enum.Parse(typeof(AgentType), src.AgentType)
                     : AgentType.NonAgent;
     ResearchSkill  = StaticSkills.GetSkillName(src.ResearchSkillID);
     LocatorService = src.LocatorService;
 }
Exemple #2
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="station">The station.</param>
        /// <param name="src">The source.</param>
        internal Agent(Station station, SerializableAgent src)
        {
            Station  = station;
            ID       = src.ID;
            Name     = src.Name;
            Level    = src.Level;
            Quality  = src.Quality;
            Division = src.DivisionName;
            AgentType type;

            if (!Enum.TryParse(src.AgentType, out type))
            {
                type = AgentType.NonAgent;
            }
            AgentType      = type;
            ResearchSkill  = StaticSkills.GetSkillName(src.ResearchSkillID);
            LocatorService = src.LocatorService;
        }