1.5, added stuff, fixed stuff
- mod icon - fixes for new vanilla clipping issues - GenClosest optimization improving repairing, wardening, tending jobs - caching for new ListerBuildings methods - DynamicDrawManager single threading - Type.GetFields caching - StatParts analyzer category - removed duplicate steam warning and optionally window - added exception handling for debug menu, incidentworker, Graphic_Multi, InitializeComps, making all those now log what mod broke and not cause black screens or whatever
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
// Copyright (c) 2023 bradson
|
||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
|
||||
using JetBrains.Annotations;
|
||||
|
||||
namespace PerformanceFish.Defs;
|
||||
|
||||
[UsedImplicitly(ImplicitUseTargetFlags.WithMembers)]
|
||||
public record struct DefPair
|
||||
{
|
||||
private uint _data;
|
||||
|
||||
public ushort First
|
||||
{
|
||||
get => (ushort)(_data >> 16);
|
||||
set => _data = (_data & 0x00_00_FF_FF) | ((uint)value << 16);
|
||||
}
|
||||
|
||||
public ushort Second
|
||||
{
|
||||
get => (ushort)_data;
|
||||
set => _data = (_data & 0xFF_FF_00_00) | value;
|
||||
}
|
||||
|
||||
public DefPair(Def first, Def second) : this(first.shortHash, second.shortHash)
|
||||
{
|
||||
}
|
||||
|
||||
public DefPair(ushort first, ushort second) => _data = Create(first, second);
|
||||
|
||||
public bool Equals(DefPair other) => _data == other._data;
|
||||
|
||||
public override int GetHashCode() => unchecked((int)_data);
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static uint Create(Def first, Def second) => Create(first.shortHash, second.shortHash);
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static uint Create(ushort first, ushort second) => ((uint)first << 16) | second;
|
||||
}
|
||||
Reference in New Issue
Block a user