-
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
32 changed files
with
968 additions
and
486 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
using System; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace LevelTemplateCreator.Assets; | ||
|
||
internal class AssetCollection<T> : ICollection<T> where T : Asset | ||
{ | ||
Dictionary<string, T> assets = new Dictionary<string, T>(); | ||
|
||
public int Count => assets.Count; | ||
|
||
public bool IsReadOnly => false; | ||
|
||
public void Add(T item) | ||
{ | ||
assets[item.Name] = item; | ||
} | ||
|
||
public void Clear() | ||
{ | ||
assets.Clear(); | ||
} | ||
|
||
public T this[string key] => assets[key]; | ||
|
||
|
||
public bool ConatinsKey(string key) => assets.ContainsKey(key); | ||
|
||
public bool TryGetValue(string key, out T value) | ||
{ | ||
return assets.TryGetValue(key, out value!); | ||
} | ||
|
||
public bool Contains(T item) | ||
{ | ||
return assets.ContainsKey(item.Name); | ||
} | ||
|
||
public void CopyTo(T[] array, int arrayIndex) | ||
{ | ||
assets.Values.CopyTo(array, arrayIndex); | ||
} | ||
|
||
public IEnumerator<T> GetEnumerator() | ||
{ | ||
return assets.Values.GetEnumerator(); | ||
} | ||
|
||
public bool Remove(T item) | ||
{ | ||
return assets.Remove(item.Name); | ||
} | ||
|
||
IEnumerator IEnumerable.GetEnumerator() | ||
{ | ||
return assets.Values.GetEnumerator(); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using LevelTemplateCreator.SceneTree; | ||
using LevelTemplateCreator.SceneTree.Main; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace LevelTemplateCreator.Assets; | ||
|
||
internal class GroundCoverInstanceAsset : Asset | ||
{ | ||
public GroundCoverInstance Instance { get; } | ||
|
||
public GroundCoverInstanceAsset(JsonDictWrapper obj, string source) : base(obj, source) | ||
{ | ||
Instance = new GroundCoverInstance(obj.Dict); | ||
} | ||
} |
File renamed without changes.
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.