-
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
23 changed files
with
120 additions
and
49 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
2 changes: 1 addition & 1 deletion
2
Grille.BeamNG.Lib/IO/ZipFileManager.cs → ...BeamNG.Lib/IO/Resources/ZipFileManager.cs
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,88 @@ | ||
using System; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using System.Diagnostics.CodeAnalysis; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Grille.BeamNG.IO.Text; | ||
public class JsonDict : IDictionary<string, object> | ||
{ | ||
SortedList<string, object> _dict; | ||
|
||
public JsonDict() | ||
{ | ||
_dict = new SortedList<string, object>(); | ||
} | ||
|
||
public JsonDict(JsonDict dict) | ||
{ | ||
_dict = new SortedList<string, object>(dict._dict); | ||
} | ||
|
||
public object this[string key] { get => _dict[key]; set => _dict[key] = value; } | ||
|
||
public ICollection<string> Keys => _dict.Keys; | ||
|
||
public ICollection<object> Values => _dict.Values; | ||
|
||
public int Count => _dict.Count; | ||
|
||
public bool IsReadOnly => ((ICollection<KeyValuePair<string, object>>)_dict).IsReadOnly; | ||
|
||
public void Add(string key, object value) | ||
{ | ||
_dict.Add(key, value); | ||
} | ||
|
||
public void Add(KeyValuePair<string, object> item) | ||
{ | ||
((ICollection<KeyValuePair<string, object>>)_dict).Add(item); | ||
} | ||
|
||
public void Clear() | ||
{ | ||
_dict.Clear(); | ||
} | ||
|
||
public bool Contains(KeyValuePair<string, object> item) | ||
{ | ||
return _dict.Contains(item); | ||
} | ||
|
||
public bool ContainsKey(string key) | ||
{ | ||
return _dict.ContainsKey(key); | ||
} | ||
|
||
public void CopyTo(KeyValuePair<string, object>[] array, int arrayIndex) | ||
{ | ||
((ICollection<KeyValuePair<string, object>>)_dict).CopyTo(array, arrayIndex); | ||
} | ||
|
||
public IEnumerator<KeyValuePair<string, object>> GetEnumerator() | ||
{ | ||
return _dict.GetEnumerator(); | ||
} | ||
|
||
public bool Remove(string key) | ||
{ | ||
return _dict.Remove(key); | ||
} | ||
|
||
public bool Remove(KeyValuePair<string, object> item) | ||
{ | ||
return ((ICollection<KeyValuePair<string, object>>)_dict).Remove(item); | ||
} | ||
|
||
public bool TryGetValue(string key, [MaybeNullWhen(false)] out object value) | ||
{ | ||
return _dict.TryGetValue(key, out value); | ||
} | ||
|
||
IEnumerator IEnumerable.GetEnumerator() | ||
{ | ||
return ((IEnumerable)_dict).GetEnumerator(); | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
Grille.BeamNG.Lib/IO/JsonDictSerializer.cs → ....BeamNG.Lib/IO/Text/JsonDictSerializer.cs
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
2 changes: 1 addition & 1 deletion
2
...e.BeamNG.Lib/IO/SimItemsJsonSerializer.cs → ...mNG.Lib/IO/Text/SimItemsJsonSerializer.cs
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
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
1 change: 1 addition & 0 deletions
1
Grille.BeamNG.Lib/SceneTree/TypeRegistry/JsonDictPropertyTypeRegistry.cs
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
using Grille.BeamNG.IO; | ||
using Grille.BeamNG.IO.Binary; | ||
|
||
namespace Grille.BeamNG; | ||
|
||
|
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
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