public static bool TryCreateCoalition(out Coalition coalition)
        {
            var dialog = new EditCoalitionDialog
            {
                Title = "Add Coalition"
            };

            return(TryGetResult(out coalition, dialog));
        }
        public static bool TryEditCoalition(Coalition editInput, out Coalition result)
        {
            var dialog = new EditCoalitionDialog
            {
                TxtName            = { Text = editInput.Name },
                TxtMemberAlliances = { Text = string.Join(",\n", editInput.MemberAlliances) },
                Title = "Edit Coalition"
            };

            return(TryGetResult(out result, dialog));
        }
        private static bool TryGetResult(out Coalition coalition, EditCoalitionDialog dialog)
        {
            if (dialog.ShowDialog().GetValueOrDefault())
            {
                coalition = new Coalition
                {
                    Name            = dialog.TxtName.Text,
                    MemberAlliances = dialog.TxtMemberAlliances.Text.Split(',', ':', ';').Select(x => x.Trim()).OrderBy(x => x).ToList()
                };

                return(true);
            }

            coalition = null;
            return(false);
        }
 protected bool Equals(Coalition other)
 {
     return(string.Equals(Name, other.Name));
 }