public ActionResult Do(IAction action, User user) { _eventLog.Add(action, user); if (_rules.UserAllowedTo(action, user, this)) { switch (action) { case Open o: Open(); return(new ActionResult(true, $"{user} opened {Name}")); case Enter e: Enter(user); return(new ActionResult(true, $"{user} entered {Name}")); } return(new ActionResult(false, $"{Name} does not know how to {action} for {user}")); } return(new ActionResult(false, $"{user} is not allowed to {action} {Name}")); }