Example #1
0
        /// <summary>
        /// IParson行動通知イベントハンドラ
        /// </summary>
        /// <param name="parson">通知元</param>
        /// <param name="action">行動</param>
        private void OutputParsonAction(IParson parson, string action)
        {
            if (Application.Current == null || Application.Current.Dispatcher == null)
            {
                return;
            }

            Application.Current.Dispatcher.Invoke(() =>
            {
                GameHistory.Add(new GameHistoryItem()
                {
                    Parson = parson, Action = action
                });
            }, System.Windows.Threading.DispatcherPriority.Background);
        }
Example #2
0
        private static void OutputAction(IParson parson, string action)
        {
            var fmt = parson is GameMaster ? ActionFormatMaster : ActionFormatPlayer;

            Console.WriteLine(fmt, parson.Name, action);
        }