forked from Impostor/Impostor
-
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.
Make vent data initialization much cleaner
- Loading branch information
Showing
25 changed files
with
310 additions
and
208 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
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,16 @@ | ||
using System.Collections.Generic; | ||
using System.Collections.ObjectModel; | ||
|
||
namespace Impostor.Api | ||
{ | ||
public static class DictionaryExtensions | ||
{ | ||
/// <summary>Returns a read-only <see cref="T:System.Collections.ObjectModel.ReadOnlyDictionary`2" /> wrapper for the dictionary.</summary> | ||
/// <returns>An object that acts as a read-only wrapper around the <see cref="T:System.Collections.Generic.IDictionary`2" />.</returns> | ||
public static ReadOnlyDictionary<TKey, TValue> AsReadOnly<TKey, TValue>(this IDictionary<TKey, TValue> dictionary) | ||
where TKey : notnull | ||
{ | ||
return new ReadOnlyDictionary<TKey, TValue>(dictionary); | ||
} | ||
} | ||
} |
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 System.Numerics; | ||
|
||
namespace Impostor.Api.Innersloth | ||
{ | ||
public interface IVent | ||
{ | ||
int Id { get; } | ||
|
||
string Name { get; } | ||
|
||
Vector2 Position { get; } | ||
|
||
IVent? Left { get; } | ||
|
||
IVent? Center { get; } | ||
|
||
IVent? Right { get; } | ||
} | ||
} |
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,17 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace Impostor.Api.Innersloth.Maps | ||
{ | ||
public interface IMapData | ||
{ | ||
public static IReadOnlyDictionary<MapTypes, IMapData> Maps { get; } = new Dictionary<MapTypes, IMapData> | ||
{ | ||
[MapTypes.Skeld] = new SkeldData(), | ||
[MapTypes.MiraHQ] = new MiraData(), | ||
[MapTypes.Polus] = new PolusData(), | ||
[MapTypes.Airship] = new AirshipData(), | ||
}.AsReadOnly(); | ||
|
||
IReadOnlyDictionary<int, IVent> Vents { get; } | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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.