Client LuaCsForBarotrauma
ICircuitBoxIdentifiable.cs
1
using
System.Collections.Generic;
2
using
System.Collections.Immutable;
3
using
System.Linq;
4
5
namespace
Barotrauma
6
{
7
public
interface
ICircuitBoxIdentifiable
8
{
9
public
const
ushort
NullComponentID
= ushort.MaxValue;
10
11
public
ushort
ID
{
get
; }
12
13
public
static
ushort
FindFreeID<T>
(IReadOnlyCollection<T> ids) where T :
ICircuitBoxIdentifiable
14
{
15
var sortedIds = ids.Select(
static
i => i.ID).ToImmutableHashSet();
16
17
for
(ushort i = 0; i <
NullComponentID
- 1; i++)
18
{
19
if
(!sortedIds.Contains(i))
20
{
21
return
i;
22
}
23
}
24
25
return
NullComponentID
;
26
}
27
}
28
}
Barotrauma.ICircuitBoxIdentifiable
Definition:
ICircuitBoxIdentifiable.cs:8
Barotrauma.ICircuitBoxIdentifiable.ID
ushort ID
Definition:
ICircuitBoxIdentifiable.cs:11
Barotrauma.ICircuitBoxIdentifiable.FindFreeID< T >
static ushort FindFreeID< T >(IReadOnlyCollection< T > ids)
Definition:
ICircuitBoxIdentifiable.cs:13
Barotrauma.ICircuitBoxIdentifiable.NullComponentID
const ushort NullComponentID
Definition:
ICircuitBoxIdentifiable.cs:9
Barotrauma
Definition:
AchievementManager.cs:12
Barotrauma
BarotraumaShared
SharedSource
CircuitBox
ICircuitBoxIdentifiable.cs
Generated by
1.9.1