public HomuTactListEntry(int id, string name, EHomuBehavior behav, EHomuSkillUsage skill, int priority) { ID = id; Name = name; Behavior = behav; Skill = skill; Priority = priority; }
protected override void OnDrawItem(DrawItemEventArgs e) { if (e.Index == -1 || Items[e.Index] == null) { base.OnDrawItem(e); return; } object item = Items[e.Index]; if (Enum.IsDefined(typeof(EHomuBehavior), item) == false) { base.OnDrawItem(e); return; } EHomuBehavior behav = (EHomuBehavior)Enum.Parse(typeof(EHomuBehavior), item.ToString()); Color texCol = Color.Black; switch (behav) { case EHomuBehavior.Attack: case EHomuBehavior.Attack1st: case EHomuBehavior.AttackLast: case EHomuBehavior.AttackWeak: texCol = Color.Maroon; break; case EHomuBehavior.React: case EHomuBehavior.React1st: case EHomuBehavior.ReactLast: texCol = Color.Violet; break; case EHomuBehavior.Avoid: texCol = Color.Gray; break; case EHomuBehavior.Coward: texCol = Color.Blue; break; } if ((e.State & DrawItemState.Selected) != 0) { e.Graphics.FillRectangle(new SolidBrush(Color.LightBlue), e.Bounds); } else { e.Graphics.FillRectangle(new SolidBrush(BackColor), e.Bounds); } e.Graphics.DrawString(behav.ToString(), Font, new SolidBrush(texCol), new Point(e.Bounds.X, e.Bounds.Y)); }
public static bool FromConfig(this string Value, out EHomuBehavior Behav) { Behav = (EHomuBehavior)(-1); if (Value == "BEHA_avoid") { Behav = EHomuBehavior.Avoid; } else if (Value == "BEHA_coward") { Behav = EHomuBehavior.Coward; } else if (Value == "BEHA_react_1st") { Behav = EHomuBehavior.React1st; } else if (Value == "BEHA_react") { Behav = EHomuBehavior.React; } else if (Value == "BEHA_react_last") { Behav = EHomuBehavior.ReactLast; } else if (Value == "BEHA_attack_1st") { Behav = EHomuBehavior.Attack1st; } else if (Value == "BEHA_attack") { Behav = EHomuBehavior.Attack; } else if (Value == "BEHA_attack_last") { Behav = EHomuBehavior.AttackLast; } else if (Value == "BEHA_attack_weak") { Behav = EHomuBehavior.AttackWeak; } return(Behav != (EHomuBehavior)(-1)); }
public static bool FromConfig(this string Value, out EHomuBehavior Behav) { Behav = (EHomuBehavior)(-1); if (Value == "BEHA_avoid") Behav = EHomuBehavior.Avoid; else if (Value == "BEHA_coward") Behav = EHomuBehavior.Coward; else if (Value == "BEHA_react_1st") Behav = EHomuBehavior.React1st; else if (Value == "BEHA_react") Behav = EHomuBehavior.React; else if (Value == "BEHA_react_last") Behav = EHomuBehavior.ReactLast; else if (Value == "BEHA_attack_1st") Behav = EHomuBehavior.Attack1st; else if (Value == "BEHA_attack") Behav = EHomuBehavior.Attack; else if (Value == "BEHA_attack_last") Behav = EHomuBehavior.AttackLast; else if (Value == "BEHA_attack_weak") Behav = EHomuBehavior.AttackWeak; return (Behav != (EHomuBehavior)(-1)); }
public bool AddTact(int ID, string Name, EHomuBehavior Behav, EHomuSkillUsage Skill, int Priority) { Add(new HomuTactListEntry(ID, Name, Behav, Skill, Priority)); return(true); }