mirror of
https://github.com/Impostor/Impostor.git
synced 2026-10-20 01:46:11 +00:00
Add MapTypes
This commit is contained in:
1 parent
a6ca856859
commit
cef3605c56
4 files changed
+26
-6
No files matched your search
@@ -33,6 +33,15 @@ namespace Impostor.Api.Innersloth
|
||||
/// Skeld = 0, MiraHQ = 1, Polus = 2.
|
||||
/// </remarks>
|
||||
public byte MapId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the map selected for this lobby
|
||||
/// </summary>
|
||||
public MapTypes Map
|
||||
{
|
||||
get => (MapTypes)MapId;
|
||||
set => MapId = (byte)value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Player speed modifier.
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
namespace Impostor.Api.Innersloth
|
||||
using System;
|
||||
|
||||
namespace Impostor.Api.Innersloth
|
||||
{
|
||||
[Obsolete("Use Map property instead of MapId, and compare with MapTypes enum.")]
|
||||
public static class MapId
|
||||
{
|
||||
// TODO: Not sure if correct, check
|
||||
public const int Skeld = 0;
|
||||
public const int MiraHQ = 1;
|
||||
public const int Polus = 2;
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace Impostor.Api.Innersloth
|
||||
{
|
||||
public enum MapTypes
|
||||
{
|
||||
Skeld = 0,
|
||||
MiraHQ = 1,
|
||||
Polus = 2,
|
||||
}
|
||||
}
|
||||
@@ -14,11 +14,11 @@ namespace Impostor.Server.Net.Inner.Objects.Systems.ShipStatus
|
||||
public DoorsSystemType(IGame game)
|
||||
{
|
||||
// TODO: Check
|
||||
var doorCount = game.Options.MapId switch
|
||||
var doorCount = game.Options.Map switch
|
||||
{
|
||||
MapId.Skeld => 13,
|
||||
MapId.MiraHQ => 2,
|
||||
MapId.Polus => 12,
|
||||
MapTypes.Skeld => 13,
|
||||
MapTypes.MiraHQ => 2,
|
||||
MapTypes.Polus => 12,
|
||||
_ => throw new ArgumentOutOfRangeException()
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user