Tanoda
SupportInfo.cs
Go to the documentation of this file.
1/******************************************************************************
2 * Copyright (C) Ultraleap, Inc. 2011-2020. *
3 * *
4 * Use subject to the terms of the Apache License 2.0 available at *
5 * http://www.apache.org/licenses/LICENSE-2.0, or another agreement *
6 * between Ultraleap and you, your company or other organization. *
7 ******************************************************************************/
8
9using System;
10using System.Collections.Generic;
11
13
20 [Serializable]
21 public struct SupportInfo {
23 public string message;
24
28 public static SupportInfo FullSupport() {
29 return new SupportInfo() { support = SupportType.Full, message = null };
30 }
31
35 public static SupportInfo Warning(string message) {
36 return new SupportInfo() { support = SupportType.Warning, message = message };
37 }
38
42 public static SupportInfo Error(string message) {
43 return new SupportInfo() { support = SupportType.Error, message = message };
44 }
45
52 if (other.support > support) {
53 return other;
54 } else {
55 return this;
56 }
57 }
58 }
59
60 public enum SupportType {
61 Full,
62 Warning,
63 Error
64 }
65
66 public static class SupportUtil {
67
71 public static void OnlySupportFirstFeature<T>(List<SupportInfo> info) {
72 for (int i = 1; i < info.Count; i++) {
73 info[i] = SupportInfo.Error("Only the first " + LeapGraphicTagAttribute.GetTagName(typeof(T)) + " is supported.");
74 }
75 }
76 }
77}
The support info class provides a very basic way to notify that something is fully supported,...
Definition: SupportInfo.cs:21
static SupportInfo Error(string message)
Helper getter to return a struct that signifies no support with an error message.
Definition: SupportInfo.cs:42
static SupportInfo Warning(string message)
Helper getter to return a struct that signifies partial support with a warning message.
Definition: SupportInfo.cs:35
static SupportInfo FullSupport()
Helper getter to return a struct that signifies full support.
Definition: SupportInfo.cs:28
SupportInfo OrWorse(SupportInfo other)
Helper method that returns either the current support info struct, or the argument support info struc...
Definition: SupportInfo.cs:51