public static VoidAppResult Error(ErrorPreset errorPreset) { switch (errorPreset) { case ErrorPreset.NotYourTurn: return(VoidAppResult.Error(AppActionResultType.UserError, "It's not your turn.")); case ErrorPreset.NotAParticipant: return(VoidAppResult.Error(AppActionResultType.UserError, "You are not a participant of this game.")); case ErrorPreset.InvalidTargets: return(VoidAppResult.Error(AppActionResultType.UserError, "Some of the targets were invalid targets.")); default: // OnLoadingData return(VoidAppResult.Error(AppActionResultType.ServerError, "There was an error while loading game data.")); } }
public VoidAppResult GetVoidAppResult() { return(this.Result == AppActionResultType.Success ? VoidAppResult.Success() : VoidAppResult.Error(this.Result, this.ErrorMessage)); }