Ejemplo n.º 1
0
        public void AddSkill(SSkill skill)
        {
            var count = 0;

            for (var i = 0; i < 4; i++)
            {
                if (Skills[i] != null)
                {
                    count++;
                }
            }

            if (count != 4)
            {
                Skills[count] = skill;
                ConsoleUtil.WriteColor("기술을 배웠습니다.");
            }
            else
            {
                var q = new List <SelectableQuestion>();

                q.Add(new SelectableQuestion("잊지 않는다"));

                foreach (var s in Skills)
                {
                    q.Add(new SelectableQuestion(s.Name));
                }

                var index = ConsoleUtil.AskSelectableQuestion("어떤 기술을 잊으시겠습니까?", q);

                if (index == 0)
                {
                    ConsoleUtil.WriteColor("기술을 잊지 않았습니다.");
                }
                else
                {
                    Skills[index - 2] = skill;

                    ConsoleUtil.WriteColor("기술을 잊었습니다.");
                }
            }
        }