fix build error on Linux/Mac

This commit is contained in:
Jesse Plamondon-Willard 2018-04-29 21:55:26 -04:00
parent 2dcd88deb1
commit fec6adf82d
1 changed files with 11 additions and 2 deletions

View File

@ -1,5 +1,4 @@
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Input;
@ -133,7 +132,7 @@ namespace StardewModdingAPI.Framework.Input
rightThumbStick: this.RightStickPos,
leftTrigger: this.LeftTrigger,
rightTrigger: this.RightTrigger,
buttons: this.GetPressedButtons().ToArray()
buttons: this.GetBitmask(this.GetPressedButtons()) // MonoDevelop requires one bitmask here; don't specify multiple values
);
}
@ -149,5 +148,15 @@ namespace StardewModdingAPI.Framework.Input
yield return button;
}
}
/// <summary>Get a bitmask representing the given buttons.</summary>
/// <param name="buttons">The buttons to represent.</param>
private Buttons GetBitmask(IEnumerable<Buttons> buttons)
{
Buttons flag = 0;
foreach (Buttons button in buttons)
flag |= button;
return flag;
}
}
}