-
Notifications
You must be signed in to change notification settings - Fork 5
/
ButtonStates.cs
49 lines (41 loc) · 1.15 KB
/
ButtonStates.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BuzzIO
{
/// <summary>
/// Class which defines the state of the buttons
/// </summary>
public class ButtonStates
{
/// <summary>True if red pressed</summary>
public bool Red;
/// <summary>True if blue pressed</summary>
public bool Blue;
/// <summary>True if orange pressed</summary>
public bool Orange;
/// <summary>True if green pressed</summary>
public bool Green;
/// <summary>True if yellow pressed</summary>
public bool Yellow;
public bool Any
{
get { return Red || Blue || Orange || Green || Yellow; }
}
public override string ToString()
{
var list = new List<string>();
if (Red)
list.Add("Red");
if (Blue)
list.Add("Blue");
if (Orange)
list.Add("Orange");
if (Green)
list.Add("Green");
if (Yellow)
list.Add("Yellow");
return string.Join(", ", list);
}
}
}