-
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.
Added map metadata file, with many options
Some options are unused for now
- Loading branch information
1 parent
2e8cf81
commit 70a223a
Showing
11 changed files
with
279 additions
and
29 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
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 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,34 @@ | ||
using System; | ||
using Newtonsoft.Json.Linq; | ||
|
||
namespace CrankItUp.Game | ||
{ | ||
public static class JobjectGetValueOrFail | ||
{ | ||
public static JToken GetValueOrFail(this JToken token, string name) | ||
{ | ||
if ( | ||
token | ||
.ToObject<JObject>() | ||
.TryGetValue(name, StringComparison.CurrentCulture, out JToken value) == false | ||
) | ||
{ | ||
throw new ArgumentException("Value not found!"); | ||
} | ||
return value; | ||
} | ||
|
||
public static T GetValueOrFail<T>(this JToken token, string name) | ||
{ | ||
if ( | ||
token | ||
.ToObject<JObject>() | ||
.TryGetValue(name, StringComparison.CurrentCulture, out JToken value) == false | ||
) | ||
{ | ||
throw new ArgumentException("Value not found!"); | ||
} | ||
return value.Value<T>(); | ||
} | ||
} | ||
} |
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 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 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 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 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
Oops, something went wrong.