public UIState Update(IUIMessage msg) { switch (msg) { case IncScore incScore: return(Update(this, incScore)); case ToGameReadyUI toGameReadyUI: return(Update(this, toGameReadyUI)); case ToGamePlayUI toGamePlayUI: return(Update(this, toGamePlayUI)); case ToGameOverUI toGameOverUI: return(Update(this, toGameOverUI)); default: throw new PatternMatchNotFoundException(msg); } }
public void SendMessage(IUIMessage message) => networkOperator.Registers.ForEach <IUserInterface>(ui => ui.ProcessMessage(message));