Example #1
0
        //Assign a job to a crew member object
        public void AssignJob(CrewMember aCrewMember, int jobnumber)
        {
            int currentjobs = aCrewMember.Assignment;

            if ((jobnumber & currentjobs) == jobnumber)
                return;  //Already assigned to job
            else
            {
                //Remove current crew assignment
                UnassignJob(GetCrewMemberKey(jobnumber), jobnumber);
                //Reassign to this crew member
                aCrewMember.Assignment = currentjobs + jobnumber;
            }
        }
Example #2
0
        //Unassign a crew member from a job
        public void UnassignJob(CrewMember aCrewMember, int jobnumber)
        {
            int currentjobs = aCrewMember.Assignment;

            if ((jobnumber & currentjobs) == jobnumber)
                aCrewMember.Assignment = currentjobs - jobnumber;
            else
                return;
        }
Example #3
0
        //Modify a crew member
        public void Modify(int oldCrewMemberKey, CrewMember newCrewMember)
        {
            if (oldCrewMemberKey < crewMemberList.Count)
            {
                FireCrewMember(oldCrewMemberKey);

                if (crewMemberList.Count > oldCrewMemberKey)
                    crewMemberList.Add(newCrewMember);
                else
                    crewMemberList.Insert(oldCrewMemberKey, newCrewMember);
            }
        }
Example #4
0
        //Train a crew member
        public void Train(CrewMember aCrewMember, int skill, int numTrainings)
        {
            int oldLevel;
            int learnedAmount;
            int newLevel;
            int raceLearningRate;
            int maxLevel;
            Race theCrewMemberRace = null;

            oldLevel = aCrewMember.GetAbilitySkillLevel(skill);
            theCrewMemberRace = OuterSpace.theRaceMgr.GetRace(aCrewMember.RacialClass);
            raceLearningRate = theCrewMemberRace.LearningRate;

            if (numTrainings < 1)  numTrainings = 1;
            learnedAmount = raceLearningRate * numTrainings;
            newLevel = oldLevel + learnedAmount;
            maxLevel = GetMaxTrainingLevel(theCrewMemberRace, skill);

            if (newLevel > maxLevel)  newLevel = maxLevel;

            aCrewMember.SetAbilitySkillLevel(skill, newLevel);
        }
Example #5
0
 //Add a person to your ship//s crew
 public void HireCrewMember(CrewMember newCrewman)
 {
     crewMemberList.Add(newCrewman);
 }