예제 #1
0
        private void EngineerCreator(string[] inputArr)
        {
            string  id        = inputArr[1];
            string  firstName = inputArr[2];
            string  lastName  = inputArr[3];
            decimal salary    = decimal.Parse(inputArr[4]);
            string  corps     = inputArr[5];

            Engineer engineer = new Engineer(id, firstName, lastName, corps, salary);

            for (int i = 6; i < inputArr.Length; i += 2)
            {
                engineer.AddPart(inputArr[i], double.Parse(inputArr[i + 1]));
            }
            soldiersList.Add(engineer);
        }