-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
207 additions
and
728 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
|
||
namespace SmartboyDevelopments.Haxxit.MonoGame | ||
{ | ||
public class BoolWrapper | ||
{ | ||
private bool status; | ||
public bool Status { get { return status; } set { status = value; } } | ||
|
||
public BoolWrapper(bool newStatus) | ||
{ | ||
status = newStatus; | ||
} | ||
|
||
public bool Equals(bool check) | ||
{ | ||
return status == check; | ||
} | ||
|
||
public override bool Equals(object obj) | ||
{ | ||
// If parameter is null return false. | ||
if (obj == null) | ||
{ | ||
return false; | ||
} | ||
|
||
// If parameter cannot be cast to Point return false. | ||
BoolWrapper bw = obj as BoolWrapper; | ||
if ((System.Object)bw == null) | ||
{ | ||
return false; | ||
} | ||
|
||
// Return true if the fields match: | ||
return (status == bw.Status); | ||
} | ||
|
||
public override int GetHashCode() | ||
{ | ||
if (status) | ||
{ | ||
return 1; | ||
} | ||
else | ||
{ | ||
return 0; | ||
} | ||
} | ||
|
||
public static implicit operator bool(BoolWrapper check) | ||
{ | ||
return check.Status; | ||
} | ||
|
||
public static implicit operator BoolWrapper(bool newStatus) | ||
{ | ||
return new BoolWrapper(newStatus); | ||
} | ||
|
||
public static bool operator ==(BoolWrapper checkWrapper, bool checkStatus) | ||
{ | ||
bool checkWrapperStatus = checkWrapper.Status; | ||
return checkWrapperStatus == checkStatus; | ||
} | ||
|
||
public static bool operator !=(BoolWrapper checkWrapper, bool checkStatus) | ||
{ | ||
bool checkWrapperStatus = checkWrapper.Status; | ||
return checkWrapperStatus != checkStatus; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.