static eClassType PlayerJobSelect() { eClassType mPlayerClassType = eClassType.NONE; Console.WriteLine("======================================================================================="); Console.WriteLine("직업을 선택하세요!"); Console.WriteLine("[1] 기사"); Console.WriteLine("[2] 궁수"); Console.WriteLine("[3] 법사"); Int32 JobNumber = Convert.ToInt32(Console.ReadLine()); switch (JobNumber) { case (int)eClassType.KNIGHT: { mPlayerClassType = eClassType.KNIGHT; } break; case (int)eClassType.ARCHER: { mPlayerClassType = eClassType.ARCHER; } break; case (int)eClassType.MAGICIAN: { mPlayerClassType = eClassType.MAGICIAN; } break; } return(mPlayerClassType); }
static void CreatePlayer(eClassType type, out Character Stat) { switch (type) { case eClassType.KNIGHT: { Stat.HP = 100; Stat.AttackPoint = 10; } break; case eClassType.ARCHER: { Stat.HP = 75; Stat.AttackPoint = 7; } break; case eClassType.MAGICIAN: { Stat.HP = 50; Stat.AttackPoint = 15; } break; default: { Stat.HP = 0; Stat.AttackPoint = 0; } break; } }
static void Main(string[] args) { eClassType PlayerClassType = eClassType.NONE; Character Player; while (true) { // 캐릭터 생성 if (PlayerClassType == eClassType.NONE) { PlayerClassType = PlayerJobSelect(); } if (PlayerClassType != eClassType.NONE) { // 기사(100/10), 궁수(75/7), 법사(50/15) CreatePlayer(PlayerClassType, out Player); Console.WriteLine($"HP{Player.HP} Attack{Player.AttackPoint}"); // 필드로 가서 몬스터랑 싸운다 EnterGame(ref Player); } } }
public PanelForClassSelection(bool IsCheckBoxes, eClassType ClassType) { int NumClass = cGlobalInfo.ListWellClasses.Count; if (ClassType == eClassType.PHENOTYPE) NumClass = cGlobalInfo.ListCellularPhenotypes.Count; this.AutoScroll = true; this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.PanelForClassSelection_MouseDown); if (ClassType == eClassType.PHENOTYPE) { PanelForPhenotypeEditing PFPE = (PanelForPhenotypeEditing)(cGlobalInfo.OptionsWindow.panelForCellularPhenotypes.Controls[0]); PFPE.Changed += new PanelForPhenotypeEditing.ChangedEventHandler(PFPE_Changed); } if (IsCheckBoxes) ListCheckBoxes = new List<System.Windows.Forms.CheckBox>(); else ListRadioButtons = new List<System.Windows.Forms.RadioButton>(); for (int IdxClass = 0; IdxClass < NumClass; IdxClass++) { System.Windows.Forms.Panel PanelForColor = new System.Windows.Forms.Panel(); PanelForColor.Width = 13; PanelForColor.Height = 13; if (ClassType == eClassType.WELL) PanelForColor.BackColor = cGlobalInfo.ListWellClasses[IdxClass].ColourForDisplay; else if (ClassType == eClassType.PHENOTYPE) PanelForColor.BackColor = cGlobalInfo.ListCellularPhenotypes[IdxClass].ColourForDisplay; PanelForColor.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; PanelForColor.Location = new System.Drawing.Point(5, PanelForColor.Height * IdxClass); PanelForColor.MouseDown += new System.Windows.Forms.MouseEventHandler(this.PanelForClassSelection_MouseDown); if (IsCheckBoxes) { System.Windows.Forms.CheckBox CurrentCheckBox = new System.Windows.Forms.CheckBox(); if (ClassType == eClassType.WELL) CurrentCheckBox.Text = cGlobalInfo.ListWellClasses[IdxClass].Name; else if (ClassType == eClassType.PHENOTYPE) CurrentCheckBox.Text = cGlobalInfo.ListCellularPhenotypes[IdxClass].Name; CurrentCheckBox.Location = new System.Drawing.Point(PanelForColor.Width + 15, CurrentCheckBox.Height * IdxClass); CurrentCheckBox.Checked = true; CurrentCheckBox.CheckedChanged += new EventHandler(CurrentCheckBox_CheckedChanged); CurrentCheckBox.MouseDown += new System.Windows.Forms.MouseEventHandler(this.PanelForClassSelection_MouseDown); System.Windows.Forms.ToolTip TT = new System.Windows.Forms.ToolTip(); TT.SetToolTip(CurrentCheckBox, CurrentCheckBox.Text); ListCheckBoxes.Add(CurrentCheckBox); PanelForColor.Location = new System.Drawing.Point(5, CurrentCheckBox.Location.Y + 5); } else { System.Windows.Forms.RadioButton CurrentRadioButton = new System.Windows.Forms.RadioButton(); if (ClassType == eClassType.WELL) CurrentRadioButton.Text = cGlobalInfo.ListWellClasses[IdxClass].Name; else if (ClassType == eClassType.PHENOTYPE) CurrentRadioButton.Text = cGlobalInfo.ListCellularPhenotypes[IdxClass].Name; CurrentRadioButton.Location = new System.Drawing.Point(PanelForColor.Width + 15, CurrentRadioButton.Height * IdxClass); CurrentRadioButton.Checked = false; CurrentRadioButton.MouseDown += new System.Windows.Forms.MouseEventHandler(this.PanelForClassSelection_MouseDown); System.Windows.Forms.ToolTip TT = new System.Windows.Forms.ToolTip(); TT.SetToolTip(CurrentRadioButton, CurrentRadioButton.Text); ListRadioButtons.Add(CurrentRadioButton); PanelForColor.Location = new System.Drawing.Point(5, CurrentRadioButton.Location.Y + 5); } this.Controls.Add(PanelForColor); } if (IsCheckBoxes) this.Controls.AddRange(ListCheckBoxes.ToArray()); else this.Controls.AddRange(ListRadioButtons.ToArray()); // (PanelForPhenotypeEditing)cGlobalInfo.OptionsWindow.panelForCellularPhenotypes.Controls[0].Pane }