コード例 #1
0
ファイル: Ears.cs プロジェクト: robbietherobot/robbie
        /// <summary>
        /// Changes the current state and notifies listeners.
        /// </summary>
        /// <param name="state">The new state to set the ears to.</param>
        private void ChangeState(EarsState state)
        {
            State = state;

            var handler = EarsStateChanged;

            // ReSharper disable once UseNullPropagation
            if (handler != null)
            {
                handler(state);
            }
        }
コード例 #2
0
ファイル: Brain.cs プロジェクト: robbietherobot/robbie
 /// <summary>
 /// Respond to ears state changed event, reporting the event to the UI / logging.
 /// </summary>
 /// <param name="state">The new state the ears are in.</param>
 private void Ears_EarsStateChanged(EarsState state)
 {
     ReportEvent("ears", $"state to '{state}'");
 }