daily update on 20241002 by nitload youmu, intrinsic function rebuild, syntax style arrange
This commit is contained in:
@@ -34,47 +34,57 @@ using System.Text;
|
||||
|
||||
namespace StgSharp.Controlling.UsrActivity
|
||||
{
|
||||
public struct JoystickTrigger : ITrigger, IEquatable<JoystickTrigger>
|
||||
public readonly struct JoystickTrigger : IClickTrigger, IEquatable<JoystickTrigger>
|
||||
{
|
||||
|
||||
private KeyStatus _triggeredStat;
|
||||
public Joystick Stick;
|
||||
private readonly Joystick _stick;
|
||||
private readonly KeyStatus _status;
|
||||
|
||||
public JoystickTrigger(Joystick targetKey)
|
||||
public JoystickTrigger( Joystick targetKey, KeyStatus status )
|
||||
{
|
||||
this.Stick = targetKey;
|
||||
this._stick = targetKey;
|
||||
_status = status;
|
||||
}
|
||||
|
||||
public int TargetKeyOrButtonID => (int)Stick;
|
||||
public int TargetKeyOrButtonID => ( int )_stick;
|
||||
|
||||
public KeyStatus TriggeredStatus => _triggeredStat;
|
||||
|
||||
public override bool Equals(object obj)
|
||||
public Joystick Stick
|
||||
{
|
||||
return base.Equals(obj);
|
||||
get => _stick;
|
||||
}
|
||||
|
||||
public KeyStatus TriggeredStatus => _status;
|
||||
|
||||
public override bool Equals( object obj )
|
||||
{
|
||||
return base.Equals( obj );
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return ((int)Stick) + (17 * ((int)_triggeredStat));
|
||||
return ( ( int )_stick ) + ( 17 * ( ( int )_status ) );
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"Key {Stick} triggered when {_triggeredStat}";
|
||||
return $"Key {_stick} triggered when {_status}";
|
||||
}
|
||||
|
||||
public static bool operator !=(JoystickTrigger left, JoystickTrigger right)
|
||||
public static bool operator !=(
|
||||
JoystickTrigger left,
|
||||
JoystickTrigger right )
|
||||
{
|
||||
return !(left == right);
|
||||
return !( left == right );
|
||||
}
|
||||
|
||||
public static bool operator ==(JoystickTrigger left, JoystickTrigger right)
|
||||
public static bool operator ==(
|
||||
JoystickTrigger left,
|
||||
JoystickTrigger right )
|
||||
{
|
||||
return (left._triggeredStat == right._triggeredStat) && (left.Stick == right.Stick);
|
||||
return ( left._status == right._status ) && ( left._stick == right._stick );
|
||||
}
|
||||
|
||||
bool IEquatable<JoystickTrigger>.Equals(JoystickTrigger other)
|
||||
bool IEquatable<JoystickTrigger>.Equals( JoystickTrigger other )
|
||||
{
|
||||
return other == this;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user