More compact string representation

This commit is contained in:
Stefanos A 2013-12-22 22:07:30 +01:00 committed by thefiddler
parent 1acf8a807b
commit 0c10f29bd8
2 changed files with 16 additions and 16 deletions

View file

@ -110,17 +110,17 @@ namespace OpenTK.Input
public override string ToString()
{
return String.Format(
"{{ABXYLR: {0}{1}{2}{3}{4}{5}; Back: {6}; BigButton: {7}; LStick: {8}; RStick: {9}}}",
A == ButtonState.Pressed ? "1" : "0",
B == ButtonState.Pressed ? "1" : "0",
X == ButtonState.Pressed ? "1" : "0",
Y == ButtonState.Pressed ? "1" : "0",
LeftShoulder == ButtonState.Pressed ? "1" : "0",
RightShoulder == ButtonState.Pressed ? "1" : "0",
Back == ButtonState.Pressed ? "1" : "0",
BigButton == ButtonState.Pressed ? "1" : "0",
LeftStick == ButtonState.Pressed ? "1" : "0",
RightStick == ButtonState.Pressed ? "1" : "0");
"{{{0}{1}{2}{3}{4}{5}{6}{7}{8}{9}}}",
A == ButtonState.Pressed ? "A" : String.Empty,
B == ButtonState.Pressed ? "B" : String.Empty,
X == ButtonState.Pressed ? "X" : String.Empty,
Y == ButtonState.Pressed ? "Y" : String.Empty,
LeftShoulder == ButtonState.Pressed ? "L" : String.Empty,
RightShoulder == ButtonState.Pressed ? "R" : String.Empty,
Back == ButtonState.Pressed ? " Back" : String.Empty,
BigButton == ButtonState.Pressed ? " Big" : String.Empty,
LeftStick == ButtonState.Pressed ? " LStick" : String.Empty,
RightStick == ButtonState.Pressed ? " RStick" : String.Empty);
}
public override int GetHashCode()

View file

@ -90,11 +90,11 @@ namespace OpenTK.Input
public override string ToString()
{
return String.Format(
"{{ULDR: {0}{1}{2}{3}}}",
IsUp ? "1" : "0",
IsLeft ? "1" : "0",
IsDown ? "1" : "0",
IsRight ? "1" : "0");
"{{{0}{1}{2}{3}}}",
IsUp ? "U" : String.Empty,
IsLeft ? "L" : String.Empty,
IsDown ? "D" : String.Empty,
IsRight ? "R" : String.Empty);
}
public override int GetHashCode()